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

# Authentication

> Create and use bearer API keys safely.

Every API request requires an API key in the `Authorization` header.

```http theme={null}
Authorization: Bearer YOUR_DATALANE_API_KEY
```

Create a key from the API section of your DataLane workspace settings. The complete key is shown only once, so copy it into your secret manager immediately.

<Warning>
  Never expose an API key in browser code, logs, or a public repository. Make DataLane requests from a trusted server.
</Warning>

## Test a key

The organization describe endpoint is a lightweight way to verify a key and inspect its organization-scoped limits.

```bash theme={null}
curl --request POST \
  --url https://api.datalane.com/v1/org/describe \
  --header "Authorization: Bearer $DATALANE_API_KEY"
```

An invalid or unknown key returns `invalid_api_key`. A key that has been disabled returns `revoked_api_key`. Both use HTTP `401`.

## Rotate a key

1. Create a new named key in workspace settings.
2. Deploy the new key to every caller.
3. Verify requests with the new key.
4. Revoke the old key.

Revocation takes effect immediately. Each key is scoped to one organization, and campaigns belonging to other organizations are returned as not found.
