> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brelio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart: your first API call

> Create an API key in Brelio and list your clinic's services with one curl command.

In two minutes you create an organization API key and call the REST API with it.

**1. Create an API key**

In Brelio, open **Configuración › Integraciones › Claves de API** and click **Nueva clave**. Name it after the tool that will use it (for example «n8n»), tick **Ver servicios** and **Ver profesionales**, and create it.

Copy the key now: Brelio shows it only once. Treat it like a password: keep it in a secret manager or an environment variable, never in code.

> [!NOTE]
>
> You need the **Gestionar integraciones** permission in Brelio, and your plan must include API access.

**2. Save it in your shell**

```bash theme={null}
export BRELIO_API_KEY="paste-your-key-here"
```

**3. List your services**

```bash theme={null}
curl https://api.brelio.app/v1/services \
  -H "Authorization: Bearer $BRELIO_API_KEY"
```

The answer is a page of services:

```json Response theme={null}
{
  "data": [
    {
      "id": "c3c8e275-a6b1-4fba-9b17-9c0a01e3ffc8",
      "name": "Fisioterapia",
      "description": null,
      "status": "active",
      "defaultDuration": 45,
      "color": null,
      "price": null,
      "createdAt": "2026-11-09T17:59:08.454Z",
      "updatedAt": "2026-11-09T17:59:08.454Z"
    }
  ],
  "next_cursor": null,
  "has_more": false
}
```

**4. Read the limits it carries**

Every answer carries the [rate limit](https://docs.brelio.com/en/concepts/rate-limits.md) headers:

```bash theme={null}
curl -sS -D - -o /dev/null https://api.brelio.app/v1/services \
  -H "Authorization: Bearer $BRELIO_API_KEY"
```

```text Response headers theme={null}
HTTP/2 200
ratelimit-policy: "burst";q=100;w=10, "standard";q=600;w=60
ratelimit: "standard";r=599;t=52
x-request-id: 64461250-2749-41ee-9ce9-1e01c2529401
```

## The same call in your language

```bash curl theme={null}
curl https://api.brelio.app/v1/services?status=active \
  -H "Authorization: Bearer $BRELIO_API_KEY"
```

```javascript Node.js theme={null}
const response = await fetch('https://api.brelio.app/v1/services?status=active', {
  headers: { Authorization: `Bearer ${process.env.BRELIO_API_KEY}` },
})
if (!response.ok) throw new Error(JSON.stringify(await response.json()))
const { data } = await response.json()
for (const service of data) console.log(service.name, service.defaultDuration, 'min')
```

```python Python theme={null}
import os
import requests

response = requests.get(
    "https://api.brelio.app/v1/services",
    params={"status": "active"},
    headers={"Authorization": f"Bearer {os.environ['BRELIO_API_KEY']}"},
    timeout=10,
)
response.raise_for_status()
for service in response.json()["data"]:
    print(service["name"], service["defaultDuration"], "min")
```

## If it fails

| Answer | Why | Fix |
| - | - | - |
| `401 PLATFORM_UNAUTHENTICATED` | No `Authorization` header, or the key is wrong or revoked | Send `Authorization: Bearer <key>` with the full key. |
| `402 PLATFORM_PLAN_REQUIRED` | The clinic's plan does not include API access | An owner adds it in **Configuración › Suscripción**. |
| `403 OPERATION_FORBIDDEN` | The key lacks the permission, named in `params.permission` | Create a key with that permission. |
| `403 DATA_AREA_OFF` | The clinic does not allow integrations to use that data area | See [data areas](https://docs.brelio.com/en/concepts/data-areas.md). |

Every code is explained in [Errors](https://docs.brelio.com/en/concepts/errors.md).

## Next

> [card] [Book an appointment](https://docs.brelio.com/en/guides/book-appointment.md)
>
> Find a free slot, book it, reschedule it and cancel it.

> [card] [Authentication](https://docs.brelio.com/en/authentication.md)
>
> Organization keys, personal keys, partner apps and MCP.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.