# Disponibilidad del agente

GET `https://api.bydomu.com/v1/booking/{slug}/availability`

Días y horas libres del agente en un mes. `configured: false` si el agente no tiene horario. OJO: la respuesta viene doblemente envuelta, `{ data: { data: ... } }`.

Permiso que pide

`portal:read`

Encabezado obligatorio

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

Nivel de acceso

Nivel 1 · sin solicitud

## Parámetros de ruta

1 · obligatorios

`slug` string · **obligatorio**

Slug de la página de agendamiento del agente

## Parámetros de consulta

2 · 1 obligatorios

`year` integer · **obligatorio**

Año (2020-2030) 2020–2030

`month` integer · opcional

Mes, de 0 (enero) a 11 (diciembre) 0–11 · nullable

## Respuesta 200

`object` · 1 campos

**`data` data**

**`data` availableDates · configured**

**`availableDates[]` date · slots**

`date` string Día (AAAA-MM-DD)

`slots` string[] Horas libres (HH:mm)

`configured` boolean `false` si el agente no tiene horario configurado

## Errores posibles

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

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **403** FORBIDDEN
- **404** NOT_FOUND
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl -G "https://api.bydomu.com/v1/booking/carlos-rodriguez/availability" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  --data-urlencode "year=1"
```

JavaScript:

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

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

const { data } = await bydomu.booking.getAvailability("carlos-rodriguez", {
  year: 1,
});
```

Python:

```python
import os, requests

r = requests.get(
    "https://api.bydomu.com/v1/booking/carlos-rodriguez/availability",
    params={"year": "1"},
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]}
)
data = r.json()
```

**Respuesta · 200 · ejemplo**

```json
{
  "data": {
    "data": {
      "availableDates": [
        {
          "date": "2026-10-05",
          "slots": [
            "09:00"
          ]
        }
      ],
      "configured": true
    }
  }
}
```
