# Listar agentes

GET `https://api.bydomu.com/v1/agents`

Miembros de la organización con al menos una propiedad publicada en el portal, ordenados por cantidad de propiedades (de más a menos).

Permiso que pide

`portal:read`

Encabezado obligatorio

`X-API-Key` · clave publicable o secreta

Nivel de acceso

Nivel 1 · sin solicitud

## Respuesta 200

`PortalAgent[]` · 8 campos

**`data[]` id · firstName · lastName · avatarUrl · bio · phone · email · propertyCount**

`id` string

`firstName` string

`lastName` string

`avatarUrl` string

`bio` string

`phone` string

`email` string

`propertyCount` integer Propiedades publicadas del agente

## Errores posibles

con la forma `{ "error": { "code", "message" } }`

- **401** UNAUTHORIZED
- **403** FORBIDDEN
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl "https://api.bydomu.com/v1/agents" \
  -H "X-API-Key: $BYDOMU_API_KEY"
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data } = await bydomu.agents.list();
```

Python:

```python
import os, requests

r = requests.get(
    "https://api.bydomu.com/v1/agents",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]}
)
data = r.json()
```

**Respuesta · 200 · ejemplo**

```json
{
  "data": [
    {
      "id": "clx1usr001",
      "firstName": "Carlos",
      "lastName": "Rodríguez",
      "avatarUrl": "https://cdn.bydomu.com/avatars/carlos.jpg",
      "bio": "Asesor con 10 años en el mercado de Bogotá.",
      "phone": "+573001234567",
      "email": "carlos@inmobiliariaandes.co",
      "propertyCount": 12
    }
  ]
}
```
