# Get an agent

Source: https://help.ruuster.com/api/agents-get

```http
GET https://api.ruuster.com/v1/agents/{agentId}
```

One agent in your brokerage. Use it to turn the agentId on a lead into a person.

- Authentication: `x-api-key` and `x-email` headers of an owner or admin
- Rate limit: 120 requests per minute per key

An agent outside your brokerage returns `404 not_found`.

## Path parameters

| Name | Type | Description |
|---|---|---|
| `agentId` | string | The agent's id (uuid), as in `agentId` on a lead |

## Response

`data.agent` is one agent object, described on [List agents](https://help.ruuster.com/api/agents-list).

## Example request

cURL:

```bash
curl -s "https://api.ruuster.com/v1/agents/e5a7d3c1-9b46-4f28-8c0e-6d2a1f7b3e95" \
  -H "x-api-key: $RUUSTER_API_KEY" \
  -H "x-email: $RUUSTER_EMAIL"
```

Node.js:

```javascript
const res = await fetch("https://api.ruuster.com/v1/agents/e5a7d3c1-9b46-4f28-8c0e-6d2a1f7b3e95", {
  headers: {
    "x-api-key": process.env.RUUSTER_API_KEY,
    "x-email": process.env.RUUSTER_EMAIL,
  },
});
const body = await res.json();
if (!body.ok) throw new Error(`${body.error.code}: ${body.error.message} (${body.requestId})`);
console.log(body.data);
```

Python:

```python
import os
import requests

res = requests.get(
    "https://api.ruuster.com/v1/agents/e5a7d3c1-9b46-4f28-8c0e-6d2a1f7b3e95",
    headers={"x-api-key": os.environ["RUUSTER_API_KEY"], "x-email": os.environ["RUUSTER_EMAIL"]},
    timeout=30,
)
body = res.json()
if not body["ok"]:
    raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]} ({body.get("requestId")})')
print(body["data"])
```

## Example response

```json
{
  "ok": true,
  "data": {
    "agent": {
      "agentId": "e5a7d3c1-9b46-4f28-8c0e-6d2a1f7b3e95",
      "firstName": "Marco",
      "lastName": "Ruiz",
      "email": "marco@saguarorealty.com",
      "phone": "+15205550134",
      "photoUrl": null,
      "role": "agent",
      "landingPageUrl": "https://saguaro.ruuster.com/agent/marco-ruiz",
      "mlsAgentIds": [
        "31877"
      ],
      "mlsOfficeIds": [],
      "status": "active",
      "createdAt": "2024-03-18T19:05:00Z",
      "removedAt": null
    }
  }
}
```
