# Authentication and scopes

> How Ladoo API keys work: sending a key, the scopes that decide what it can do, presets, expiry dates, IP limits and how a key follows the person who made it.

Source: https://tryladoo.com/docs/developers/authentication-and-scopes · Updated 2026-11-21

Every request to `https://api.tryladoo.com/v1` needs an API key. Create keys under **Settings → Developers** in Ladoo (owners and admins only), or with `POST /v1/api-keys` from a key that has the `api_keys:write` scope.

## Send the key

Send the key as a bearer token in the `Authorization` header:

```sh
curl https://api.tryladoo.com/v1/workspace \
  -H "Authorization: Bearer lsk_…"
```

- A key looks like `lsk_` followed by a 12-character id, an underscore and a long secret. The `lsk_…` prefix before the second underscore is safe to show and is what Ladoo lists next to the key. The rest is secret.
- Ladoo keeps only a hash of the key. It's shown once, when you create it. If you lose it, revoke it and make a new one.
- A missing, malformed or revoked key gets `401 unauthorized`.
- A key belongs to one workspace. Everything it reads and changes is in that workspace. To work in an agency's client workspaces, see [Agencies: client workspaces through the API](https://tryladoo.com/docs/developers/agencies-and-client-workspaces).

Keep keys on your server. Never put one in a web page, a mobile app or a public repository.

## Scopes

A key's scopes decide what it can do. Most areas have a `:read` scope for looking and a `:write` scope for changing. A request that needs a scope the key doesn't have gets `403 insufficient_scope`, and `error.details.required` names the scope it needed.

| Scope                                       | Lets a key                                                                               |
| ------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `calls:read`                                | List calls and chats with transcripts and summaries, call analytics and blocked callers. |
| `people:read`, `people:write`               | Read people, and add, edit or delete them.                                               |
| `bookings:read`, `bookings:write`           | Read the appointments Ladoo booked, and cancel them.                                     |
| `agents:read`, `agents:write`               | Read agents and their workflows; edit, publish or roll them back; block callers.         |
| `knowledge:read`, `knowledge:write`         | Read knowledge bases, and add or change sources and answers.                             |
| `webhooks:read`, `webhooks:write`           | Read webhook endpoints and deliveries, and create, change or test endpoints.             |
| `phone_numbers:read`, `phone_numbers:write` | List numbers, and buy, release or reassign them. Buying a number costs money.            |
| `voices:read`                               | List voices.                                                                             |
| `test_sessions:write`                       | Start browser test sessions with an agent.                                               |
| `members:read`, `members:write`             | Read team members and invitations, and invite, change or remove people.                  |
| `teams:read`, `teams:write`                 | Read teams and on-call settings, and change them.                                        |
| `workspace:write`                           | Change the workspace's name and settings, including booking confirmations.               |
| `clients:read`, `clients:write`             | In an agency, list client workspaces and their usage, and add or change them.            |
| `api_keys:read`, `api_keys:write`           | List API keys, and create or revoke them.                                                |
| `billing:read`, `billing:write`             | Read the plan and usage, and change the plan or client billing.                          |
| `integrations:read`, `integrations:write`   | Read connected calendars and the CRM connection, and change them.                        |
| `audit:read`                                | Read the audit log.                                                                      |

`GET /v1/workspace` works with any key and shows the scopes of the key you sent, so you can check one before you rely on it.

## Presets

When you create a key you can pick a preset instead of ticking scopes one by one:

| In Ladoo           | In the API                 | Scopes                                                                                 |
| ------------------ | -------------------------- | -------------------------------------------------------------------------------------- |
| **Full access**    | `"preset": "full"`         | Everything you can do in the workspace.                                                |
| **Read only**      | `"preset": "read_only"`    | Every `:read` scope you have.                                                          |
| **Calls & People** | `"preset": "calls_people"` | `calls:read`, `people:read`, `people:write` and `bookings:read`. For CRMs and reports. |
| **Zapier**         | (send the scopes)          | What the Ladoo app on Zapier needs: calls, bookings, people, knowledge and webhooks.   |

Give each integration its own key with the fewest scopes it needs. If one leaks, you revoke one key and nothing else stops working.

## Create a key with the API

```sh
curl https://api.tryladoo.com/v1/api-keys \
  -H "Authorization: Bearer $LADOO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7d2f4c1e-0b8a-4e5f-9c3d-2a1b0c9d8e7f" \
  -d '{
    "name": "Rivera Plumbing reports",
    "preset": "read_only",
    "expires_at": "2027-06-01T00:00:00Z",
    "allowed_ips": ["203.0.113.10", "198.51.100.0/24"]
  }'
```

- Send `scopes` (a list) or `preset`, not both. With neither, the key gets every scope you have.
- `expires_at` is optional. After it, requests with the key get `401 key_expired`.
- `allowed_ips` is optional: up to 50 IP addresses or CIDR ranges. A request from anywhere else gets `403 ip_not_allowed`. Leave it out to allow any address.
- The reply's `key` is the full key, shown only this once.

A key that creates a key passes on its own limits: the new key can't have scopes the first one lacks, can't expire later, and is held to the same IP addresses.

## A key never does more than the person who made it

A key made by someone in your workspace acts with, at most, what that person can do there right now:

- If their role is lowered, the key loses the scopes their new role doesn't have. If they're promoted back, the scopes come back.
- If they leave the workspace, or their Ladoo account is suspended, the key stops working (`401 unauthorized`).

So when someone leaves, the keys they made stop with them. For an integration that must outlive one person, have an owner create its key.

## Pick an API version

Each key is pinned to the API version that was current when it was made, and its requests keep that behavior. Send `Ladoo-Version` to choose another. See [API versions and safe retries](https://tryladoo.com/docs/developers/versions-and-limits).

## Revoke a key

Click **Revoke** next to the key under **Settings → Developers**, then **Revoke key**, or send `DELETE /v1/api-keys/{id}`. Requests with it fail from then on. This can't be undone.

`GET /v1/api-keys` lists active keys with `last_used_at` and `last_used_ip`, so you can spot a key nothing uses any more.
