# API keys (/developers/api-keys)

> Create, scope, rotate and revoke the workspace API keys that authenticate REST and MCP requests.

> **Preview:** this feature is in preview. The contract is stable enough to build against, but details may change before general availability.

API keys authenticate server-to-server requests to the Luso8 API and the [remote MCP server](/developers/mcp). Each key belongs to one workspace and carries a set of scopes that limit what it can do.

## Key format [#key-format]

Keys start with a fixed prefix followed by 40 random characters:

```text
luso8_sk_live_<40 characters>
```

The `luso8_sk_live_` prefix makes keys easy to recognize in logs and by secret scanners. If you find a key somewhere it should not be, revoke it immediately.

## Create a key [#create-a-key]

Only workspace **Owners** and **Administrators** can manage API keys. See [Roles](/luso8/settings/roles).

<Steps>
<Step>
### Open the API keys page [#open-the-api-keys-page]

In Luso8, open **Settings → Developers → API keys**.
</Step>

<Step>
### Name the key and choose scopes [#name-the-key-and-choose-scopes]

Click **Create key**. Give it a name that says where it is used, such as `website-signup-sync` or `data-warehouse-export`, then select the narrowest set of [scopes](#scopes) the integration needs.
</Step>

<Step>
### Copy the key [#copy-the-key]

The full key is shown **once**. Copy it into your secret manager or environment before closing the dialog. Luso8 stores only a hash, so a lost key cannot be recovered; create a new one instead.
</Step>
</Steps>

## Use a key [#use-a-key]

Send the key as a bearer token, or in the `X-API-Key` header:

```bash tab="Authorization header"
curl https://api.luso8.rexplore.ai/api/v1/companies \
  -H "Authorization: Bearer $LUSO8_API_KEY"
```

```bash tab="X-API-Key header"
curl https://api.luso8.rexplore.ai/api/v1/companies \
  -H "X-API-Key: $LUSO8_API_KEY"
```

## Scopes [#scopes]

A scope is `<resource>:read` or `<resource>:write`. Write includes read, so a key with `deals:write` can also list deals. The special scope `*` grants full access to every resource, including resources added later.

| Resource | `read` lets you | `write` also lets you |
| --- | --- | --- |
| `contacts` | List, search and get contacts | Create, bulk create, update and delete contacts, set custom fields |
| `companies` | List, search, count and get companies | Create, bulk create, update and delete companies |
| `deals` | Read deals, prospects, customers, products and pipeline summaries | Create and update them, convert leads to deals and deals to customers |
| `leads` | Read leads and AI lead search results | Create and update leads, start, answer and cancel lead searches |
| `lists` | Read lists and their members | Create lists, add and remove contacts |
| `campaigns` | Read campaigns, steps, enrolled contacts and analytics | Create and edit campaigns and steps, enroll contacts, launch, pause, resume |
| `conversations` | Read inbox and support conversations and messages | Send messages, update status or assignment, hand off to a human |
| `calls` | Read call logs, recordings, performance and scheduled calls | Schedule, update and cancel calls, update call logs |
| `appointments` | Read appointments, upcoming meetings and stats | Create, update, cancel and change the status of appointments |
| `tickets` | Read tickets, categories and comments | Create, update and delete tickets, add comments |
| `agents` | Read AI agents, voice agents and their conversations | Create, update, enable and disable agents |
| `knowledge` | Read folders, documents and search the knowledge base | Create folders, upload and delete documents |
| `workflows` | Read workflows, events and runs | Create and edit workflows, trigger and cancel runs |
| `reports` | Read workspace metrics and export reports | (no write operations) |

## Rotate a key [#rotate-a-key]

Rotate keys on a schedule and whenever someone with access leaves the team:

1. Create a new key with the same scopes.
2. Deploy it to your integration and confirm requests succeed.
3. Revoke the old key.

Revoking takes effect immediately: the next request with that key returns `401 Invalid API key`.

## Best practices [#best-practices]

- **One key per integration.** You can revoke one integration without breaking the others, and the key name tells you what will stop.
- **Least privilege.** Grant `read` unless the integration writes, and avoid `*` outside short-lived experiments.
- **Server only.** Never ship a key in a browser, a mobile app or client-side code. Proxy requests through your backend.
- **Keep keys out of URLs and logs.** Send them in headers, and mask them in your own logging.
- **Watch the rate limit.** Each key gets 600 requests per minute; see [Rate limits](/developers/rate-limits).