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

# Authentication

> Organization API keys, permissions per resource, the MCP read-only preset and legacy keys.

Send your organization API key as a bearer token on every request:

```bash theme={null}
curl -s "https://app.eloout.com/api/v1/me" \
  -H "Authorization: Bearer $ELOOUT_API_KEY"
```

A key is `elo_` followed by 43 characters. It belongs to one organization and only reaches that
organization's data.

## Create and revoke keys

Organization admins manage keys in Eloout under **Settings → API keys**.

1. Name the key after the system that will use it, so you know what to revoke later.
2. Choose its permissions. Choose at least one, and only what that system needs.
3. Copy the key. **It is shown only once**: store it somewhere safe right away.

Revoke a key from the same page as soon as a system stops using it or the key may have leaked.
Systems using a revoked key stop working immediately, and revoking cannot be undone.

## Permissions per resource

Each operation needs exactly one permission, listed as `x-eloout-required-scopes` on every
endpoint of the [API reference](https://docs.eloout.com/api-reference/introduction.md). Reading and writing are separate
permissions: a write permission does not include the read.

| Permission | Allows |
| - | - |
| `opportunities:read` | List and read opportunities |
| `opportunities:write` | Create and update opportunities, including batch upserts |
| `pipelines:read` | Read pipelines and their stages |
| `custom-fields:read` | Read the opportunity custom field definitions |
| `lists:read` | Read the lists and their columns |
| `records:read` | Read list records, by code, ID or external ID |
| `records:write` | Create and update list records and change their stage |
| `webhooks:read` | Read webhook subscriptions and their deliveries |
| `webhooks:write` | Create, test and delete webhook subscriptions |

`GET /me` needs a valid key but no permission. It returns the key's organization and its effective permissions,
so a system can check what it may do:

```json theme={null}
{
  "ok": true,
  "data": {
    "organization": { "id": "6f1d2c3b-4a59-4e6f-8a7b-9c0d1e2f3a4b", "name": "Acme" },
    "apiKey": {
      "id": "f5e6f7a8-9b0c-4e1f-8a3b-4c5d6e7f8a9b",
      "name": "MCP read only",
      "scopes": ["opportunities:read", "pipelines:read", "lists:read", "records:read"],
      "legacy": false
    }
  }
}
```

A key without the permission an operation needs gets `403 FORBIDDEN`, with the missing
permission in `details.requiredScope`:

```json theme={null}
{
  "ok": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "This API key lacks the opportunities:write scope",
    "details": { "requiredScope": "opportunities:write" }
  }
}
```

## MCP read-only preset

The key form has a **Use the MCP read-only preset** button. It selects exactly these four
permissions and nothing else:

* `opportunities:read`
* `pipelines:read`
* `lists:read`
* `records:read`

It is meant for the Eloout MCP server, which is not released yet and will only read.

## Legacy keys

Keys created before permissions per resource (API version 1.1.0) are marked **Legacy** in the
keys list, and `GET /me` returns `"legacy": true` for them. They keep the access every key had
before:

* `opportunities:read` and `opportunities:write`
* `pipelines:read` and `custom-fields:read`
* `webhooks:read` and `webhooks:write`

Their list grants carry over as follows:

* `lists:read` is kept, and on a legacy key it also grants `records:read`.
* `lists:write` is retired: it grants nothing by itself, and the keys list shows it as a retired
  grant. A legacy key that holds it gets `records:write` instead.

`GET /me` lists the resulting permissions. Record writes on any other key need `records:write`.

> [!TIP]
>
> Replace each legacy key: create a key with only the permissions its system needs, switch the
> system to it, then revoke the legacy key.

## Missing or invalid key

A missing, malformed, unknown or revoked key gets `401 UNAUTHENTICATED`:

```json theme={null}
{ "ok": false, "error": { "code": "UNAUTHENTICATED", "message": "Invalid or revoked API key" } }
```

Repeated failed authentications from one client IP are rate limited. See
[Errors and rate limits](https://docs.eloout.com/errors.md).

## Keep keys safe

* A key can read and change the organization's data within its permissions. Treat it like a
  password: keep it in a secret manager or an environment variable, never in code or in a URL.
* Use one key per system, so you can revoke one without stopping the others.
* Call the API from your servers, not from a browser or a mobile app.


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