> For the complete documentation index, see [llms.txt](https://docs.adaptria.locaria.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adaptria.locaria.com/internal-api/authentication.md).

# Authentication & API keys

Every request to the Adaptria Public API is authenticated with a static API key sent in the **`Api-key`** HTTP header (note the exact casing). There is no token exchange, refresh token or separate sign-in step: the key is sent directly on each request.

## Generating an API key

You can create an API key in either of two ways:

* **Adaptria Portal**: go to **Settings → API Keys** and generate a new key.
* **Contact your admin**: ask your Adaptria administrator to create an API key for you.

Keys are issued in the format `lla_live_<32 characters>`.

{% hint style="warning" %}
The full key is shown **only once**, at the moment it is created. Copy it and store it somewhere secure straight away, because it cannot be retrieved again later. If you lose a key, revoke it and generate a replacement.
{% endhint %}

## Key scope

An internal or connector key carries **broader scope** than a client key. Where a client credential is limited to the companies belonging to a single customer, a connector credential can read across the companies its owner is authorised to see and can create projects directly. As with any credential, list and detail endpoints still filter to what the key's owner is permitted to access.

## Sending the key

Add the `Api-key` header to every request:

```bash
curl https://api.adaptria.locaria.com/api/public/v1/projects \
  -H "Api-key: lla_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Invalid or revoked keys

If a key is missing, malformed, revoked or expired, the API responds with `401 Unauthorized` and a machine-readable error code (for example `AUTH_API_KEY_INVALID`, `AUTH_API_KEY_REVOKED` or `AUTH_API_KEY_EXPIRED`). See [Errors & status codes](/internal-api/errors.md) for the full error envelope.
