> ## 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 REST API: getting started

> Create an API key, make your first request and read the response. The SmartAlex REST API covers contacts, deals, calls, campaigns, agents and more.

The SmartAlex REST API lets your own code read your workspace over HTTPS with an API key. It covers contacts, deals, calls, campaigns, agents, knowledge, phone numbers and more. Create a key in SmartAlex, send it as a bearer token, and every response comes back as JSON. The 95 endpoints in this reference are generated from the same contract the server checks, so they always match what the API accepts.

> [!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. Workspace owners and admins create keys, and the page needs the [Power Tools add-on](https://docs.getsmartalex.com/pricing.md#add-ons).

## How do I make my first request?

**1. Create a key**

Open **Webhooks & API**, choose **API keys**, then **Create a read-only key** (owners see **Create a key**). Give it a **Name**. Tick what it may use under **What it can read** (**What it can do** when the button says **Create a key**). Then pick when it **Stops working**: never, in 30 days, in 90 days or in a year. Press **Create key**.

![Create a read-only key drawer with Name, scopes and expiry](https://mintcdn.com/smartalex/1aJfW-RE1YMT8lGO/images/screens/developer-hub/api-key-create.webp?fit=max\&auto=format\&n=1aJfW-RE1YMT8lGO\&q=85\&s=6bb472a4b4e5f605f05892b825f990d8)

Name the key, tick what it can read and pick an expiry

**2. Copy the key**

The key starts `sa_live_` and is shown only once. Copy it into your password manager or your server's secret store. If you close the panel first, create a new key.

**3. Send a request**

The panel shows a **Try it** request you can paste into a terminal. It reads your 10 newest contacts:

```bash theme={null}
curl "https://api.getsmartalex.com/functions/v1/rest-api/contacts?view=crm&per_page=10" \
  -H "Authorization: Bearer sa_live_your_key"
```

**4. Read the response**

Lists come back as `data` with a `meta` block for paging:

```json theme={null}
{
  "data": [
    { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "first_name": "Sarah", "last_name": "Chen", "phone": "+14155550123" }
  ],
  "meta": { "total": 247, "page": 1, "per_page": 10 }
}
```

## What happens to a request?

Every request goes through the same checks. This diagram shows them in order.

```mermaid theme={null}
sequenceDiagram
    participant Code as Your code
    participant API as SmartAlex REST API
    participant WS as Your workspace
    Code->>API: GET /contacts with the API key
    API->>API: Key is real, active and not expired
    API->>API: Under 60 requests this minute
    API->>API: Key holds the contacts:read scope
    API->>API: Workspace has Power Tools
    API->>WS: Read contacts in this workspace only
    WS-->>API: Contacts
    API-->>Code: 200 with data and meta
```

If a check fails, the API answers with an error and changes nothing. [Rate limits and errors](https://docs.getsmartalex.com/api-reference/rate-limits-and-errors.md) lists each one.

## What is the base URL?

```text theme={null}
https://api.getsmartalex.com/functions/v1/rest-api
```

Add the path from the reference, such as `/contacts` or `/calls/{id}`. Send JSON bodies with `Content-Type: application/json`.

## What does each response look like?

| Response | Shape |
| - | - |
| A list | `{ "data": [ ... ], "meta": { "total", "page", "per_page" } }` |
| One item | `{ "data": { ... } }` |
| An error | `{ "error": "What went wrong", "code": "SCOPE_REQUIRED" }`, where `code` is there when the error has one |

List endpoints take `page` (from 1) and `per_page` (25 by default, 100 at most). Any other query parameter is passed to the endpoint as a filter, such as `updated_since` on contacts.

## What can the API do?

The reference groups the 95 endpoints by area.

| Area | Endpoints | For example |
| - | - | - |
| Contacts | 7 | List, find by name or phone, add, import up to 1,000, change, delete |
| Deals | 4 | List, add, move a stage, delete |
| Calls | 4 | List, read a transcript and summary, totals for a period, export with charges |
| Campaigns | 11 | Create, add people, start, pause, resume, schedule, stop |
| Callbacks | 8 | List, reschedule, cancel, call back now, block a caller |
| Agents | 13 | Create, change, read and edit prompt sections, place a test call |
| Knowledge | 9 | Add text, import a website, give an agent knowledge |
| Custom API tools | 8 | Create a tool your agent calls during a call, attach it to an agent |
| Phone numbers | 8 | List, search, buy, choose which agent answers, release |
| Analytics | 1 | Call and campaign analytics |
| Account | 6 | Plan and usage, service status, widget install code, what this key can do |
| Webhooks | 3 | List, add, delete |
| Gates | 3 | List gates, read the gate log, open a gate |
| Team | 5 | List members, invite, change a role, remove |
| Settings | 5 | Business hours and notification settings |

Each endpoint page names the scope it needs. `GET /me/tools` returns what your key can do right now.

## Should I use the REST API or the MCP server?

| | REST API | MCP server |
| - | - | - |
| Who uses it | Your own code | AI apps such as Claude, ChatGPT and Cursor |
| How it signs in | An API key | The person signs in and presses **Approve** |
| What it can do | The scopes on the key | That person's role |
| Risky actions | Run when called | Show a preview and wait for a yes |
| Rate limit | 60 requests a minute per key | 100 requests a minute per workspace |
| Start here | This page | [Connect an AI app](https://docs.getsmartalex.com/mcp/getting-started.md) |

## Questions people ask

> [accordion] Does SmartAlex have an API?
>
> Yes, two. The REST API takes an API key and suits your own code, such as a CRM sync. The [MCP server](https://docs.getsmartalex.com/mcp/overview.md) lets AI apps such as Claude and ChatGPT work in SmartAlex as a signed-in person.

> [accordion] Can I export my data with the API?
>
> Yes. A key you create yourself can read contacts, deals, campaigns, knowledge and more, and can export calls with their charges. Page through lists 100 at a time.

> [accordion] Can my API key add or change data?
>
> Keys you create yourself read data. Our support team can give a key write scopes, such as adding contacts or starting campaigns, on request. [Keys and scopes](https://docs.getsmartalex.com/api-reference/authentication.md) lists them.

> [accordion] Should I use the REST API or the MCP server?
>
> Use the REST API for code that runs on its own, such as a nightly sync. Use the MCP server when a person works through an AI app, which signs in as them and asks before risky actions.

## Related

> [card] [Keys and scopes](https://docs.getsmartalex.com/api-reference/authentication.md)
>
> Who creates keys, and what each scope allows.

> [card] [Rate limits and errors](https://docs.getsmartalex.com/api-reference/rate-limits-and-errors.md)
>
> Paging, limits and every error.

> [card] [Webhooks](https://docs.getsmartalex.com/api-reference/webhooks.md)
>
> Hear about new contacts, finished calls and deal moves.

> [card] [MCP server](https://docs.getsmartalex.com/mcp/overview.md)
>
> Let an AI app run SmartAlex for you.


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