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

> ## Agent Instructions
> For short, quotable answers about SmartAlex (what it is, who it is for, what it costs, where it runs, how it keeps data safe, which apps it connects to), read the facts page at /ai/facts on this site first, then the page it links to. Its last table maps every section of these docs.
> For how to do something, use the step-by-step pages: /learn for whole paths, and each section's first-time pages such as /calls/buy-your-first-number, /agents/create-an-agent or /campaigns/import-your-first-contacts. Give the click path exactly as written there, for example Calls, then Numbers, then Buy number, with the bold button labels unchanged.
> Prices come from the Pricing page at /pricing and the pages under /pricing. Quote a price exactly as written there, with its currency and unit.
> Short answers to common questions are under /help, grouped by section. Legal documents are summarised under /legal; each summary links to the binding text, which prevails over the summary.
> If a feature or screen is not described in these docs, say that you could not find it rather than guessing.
> Pages under /comparisons describe other companies' products as of the date on each page. For SmartAlex's own features and prices, use the product pages.
> The MCP server at /mcp on this site only searches this documentation. To work inside your own SmartAlex workspace (agents, calls, campaigns, contacts), use the SmartAlex MCP server described at /mcp/overview.

# SmartAlex API keys and scopes

> How SmartAlex API keys work: who creates them, how to send one, what each scope allows, and how to expire, revoke and keep a key safe.

Every SmartAlex REST API request carries an API key in the `Authorization` header. A key belongs to one workspace, holds a list of **scopes** that say what it may do, and works until it expires or is revoked. Workspace owners and admins create read-only keys themselves. Our support team adds write scopes on request.

> [!NOTE]
>
> In SmartAlex: **Settings → Webhooks & API**, then **Create key**, **Open** or a key's name in the **API keys** panel. That opens the **Webhooks & API** page (/developers) on its **API keys** tab. You need to be a workspace owner or admin, and the workspace needs the [Power Tools add-on](https://docs.getsmartalex.com/pricing.md#add-ons).

## How do I send the key?

Send it as a bearer token on every request:

```bash theme={null}
curl "https://api.getsmartalex.com/functions/v1/rest-api/deals" \
  -H "Authorization: Bearer sa_live_your_key"
```

Keys start `sa_live_`. They are shown once, when you create them. SmartAlex keeps only a fingerprint, so a lost key cannot be shown again. Make a new one.

## How does SmartAlex check a key?

The API runs these checks in order, stopping at the first failure, and this diagram shows each check and its error.

```mermaid theme={null}
flowchart TD
    A["Request with a key"] --> B{"Key real, active and in date?"}
    B -->|No| E1["401: create a new key"]
    B -->|Yes| D{"Under 60 requests this minute?"}
    D -->|No| E2["429: wait and retry"]
    D -->|Yes| G{"Key holds this endpoint's scope?"}
    G -->|No| E3["403: use a key with the scope"]
    G -->|Yes| H{"Workspace has Power Tools?"}
    H -->|No| E4["402: add Power Tools"]
    H -->|Yes| OK(["Request runs in this workspace"])
```

## What can each scope do?

Each endpoint needs one scope, named on its page, and the **Who adds it** column says who can put it on a key.

| Scope | Allows | Who adds it |
| - | - | - |
| `contacts:read` | Read contacts | Owner or admin |
| `contacts:write` | Add, change and delete contacts | Support |
| `deals:read` | Read deals | Owner or admin |
| `deals:write` | Add, change and delete deals | Support |
| `calls:read` | Read calls, transcripts and summaries | Support |
| `calls:export` | Export calls with their charges | Owner or admin |
| `campaigns:read` | Read campaigns | Owner or admin |
| `campaigns:write` | Create, change, pause and stop campaigns | Support |
| `campaigns:run` | Start campaigns and add people to them | Support |
| `callbacks:read` | Read scheduled callbacks | Owner or admin |
| `callbacks:write` | Reschedule and cancel callbacks | Support |
| `callbacks:call` | Call people back now | Support |
| `blocked_callers:read` | Read blocked callers | Owner or admin |
| `blocked_callers:write` | Block and unblock callers | Support |
| `agents:read` | Read agents, prompts and test calls | Support |
| `agents:write` | Create, change and delete agents | Support |
| `agents:test` | Place test calls | Support |
| `knowledge:read` | Read the knowledge base | Owner or admin |
| `knowledge:write` | Add, import and delete knowledge | Support |
| `http_tools:read` | Read custom API tools | Owner or admin |
| `http_tools:write` | Create, change and attach custom API tools | Support |
| `phone_numbers:read` | Read phone numbers and quotes | Owner or admin |
| `phone_numbers:write` | Search, change and release phone numbers | Support |
| `phone_numbers:buy` | Buy phone numbers | Support |
| `analytics:read` | Read analytics | Owner or admin |
| `account:read` | Read the plan, usage and agent slot prices | Owner or admin |
| `billing:spend` | Buy agent slots | Support |
| `platform:read` | Read service status and available tools | Owner or admin |
| `widget:read` | Read the website widget install code | Owner or admin |
| `webhooks:read` | Read webhooks | Owner or admin |
| `webhooks:manage` | Add and delete webhooks | Support |
| `gates:read` | Read your gates and who opened them | Owner or admin |
| `gates:open` | Open your gates | Owner |
| `team:read` | Read team members and invitations | Owner or admin |
| `team:write` | Invite, change and remove team members | Support |
| `settings:read` | Read business hours and notifications | Owner or admin |
| `settings:write` | Change business hours and notifications | Support |

`GET /me/tools` shows what a key can do at any time.

## How do I get a scope that support adds?

Email [support@getsmartalex.com](mailto:support@getsmartalex.com) from your workspace with the scope and what you will use it for. For example, ask for `calls:read` to read each call's summary and transcript after a [Call finished](https://docs.getsmartalex.com/api-reference/webhooks.md#what-does-the-call-finished-event-hold) webhook.

A key's scopes are set when it is made, so a scope cannot be added to a key you already have. Our support team makes a new key with every scope you need. Move your code to the new key, then revoke the old one.

`calls:read` covers reading calls: `GET /calls`, `GET /calls/summary` and `GET /calls/{id}`. The call comes back without its transcript when the person who made the key cannot see transcripts in your workspace, for example after they leave it.

## Who does a key act as?

A key with scopes belongs to the **workspace**, not to the person who made it. When it is created, its scopes are limited to what that person may do, and after that it keeps working even if they leave. The key list then marks it **Left the workspace**, so an owner or admin can revoke it.

Keys made before scopes existed show as **Older key: read** or **Older key: read and write**. They follow the page permissions of the person who made them, and they cannot open gates.

## How do I expire or revoke a key?

* **Expire.** Pick a date under **Stops working** when you create the key: in 30 days, in 90 days or in a year. The list shows each key's expiry and when it was last used.
* **Revoke.** Press **Revoke** on the key's row in **API keys**, then **Revoke key**, and anything using it, such as a CRM sync, stops working at once.
* **Rotate.** Create a new key with the same scopes, move your code to it, then revoke the old one.

## How do I keep a key safe?

> [!WARNING]
>
> Treat a key like a password. Keep it on your server or in a secret store, never in a web page, a mobile app or a public repository. The website widget needs no API key.

* Give each system its own key, so you can revoke one without stopping the others.
* Tick only the scopes the system needs.
* Set an expiry for keys used in tests or by contractors.

## Questions people ask

> [accordion] Can I get an API key that writes data?
>
> Yes. Keys you create yourself read data, and owners can add the gate scopes. Our support team adds write scopes, such as adding contacts or starting campaigns, on request.

> [accordion] What happens to a key when the person who made it leaves?
>
> A key with scopes belongs to the workspace, so it keeps working. The key list marks it **Left the workspace**, so an owner or admin can revoke it and make a new one.

> [accordion] How do I rotate an API key?
>
> Create a new key with the same scopes, move your code to it, then revoke the old key. Anything still using the old key stops working straight away.

> [accordion] Can I use an API key in a web page?
>
> No. Anyone who opens the page could copy it. Keep the key on your server and call SmartAlex from there. The website widget needs no API key.

## Related

> [card] [Getting started](https://docs.getsmartalex.com/api-reference/introduction.md)
>
> Create a key and make your first request.

> [card] [Rate limits and errors](https://docs.getsmartalex.com/api-reference/rate-limits-and-errors.md)
>
> What each 401, 402 and 403 means.

> [card] [How AI apps sign in](https://docs.getsmartalex.com/mcp/authentication.md)
>
> The MCP server uses sign-in instead of keys.

> [card] [Webhooks](https://docs.getsmartalex.com/api-reference/webhooks.md)
>
> Signed events sent to your systems.


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