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

# Introduction

> The LeadBeast REST API: keys, scopes, requests and responses.

The REST API gives scripts and server-side agents the same tools an AI app gets over [MCP](https://www.leadbeast.io/docs/mcp/connect.md). Every endpoint is listed below this page, generated from the live server.

```
https://app.leadbeast.io/api/v1
```

## API keys

Create a key under Settings > MCP / API > API keys > Create key. Give it a name, pick its access and set an expiry if you want one. The key starts with `lb_` and is shown once, right after you create it. LeadBeast stores only a hash.

Send it as a bearer token:

```bash theme={null}
curl https://app.leadbeast.io/api/v1/leads \
  -H "Authorization: Bearer $LEADBEAST_API_KEY"
```

A key belongs to one project and acts as the user who created it. Revoke it from the same page. It stops working immediately.

## Scopes

A key gets only the access you give it. Full access grants every scope, Read only grants the four read scopes, and Custom lets you pick.

| Scope | Covers |
| - | - |
| `business:read` | Company profile, LinkedIn accounts, project overview |
| `business:write` | Update the company profile |
| `leads:read` | List and read leads |
| `leads:write` | Update and suppress leads |
| `campaigns:read` | List and read campaigns and messages waiting for review |
| `campaigns:write` | Create, change, delete, turn on and off, add leads, approve and reject messages |
| `inbox:read` | List and read conversations |
| `inbox:write` | Send and draft replies, change stage, archive |

Each endpoint in the reference names its scope. A call outside the key's scopes returns `403` with `reason_code: insufficient_scope`.

## Requests

* `GET` endpoints take their arguments as query parameters.
* `POST`, `PATCH` and `DELETE` take a JSON body with `Content-Type: application/json`. The body is capped at 64 KB.
* Path parameters are ids from a list endpoint: a campaign id from `GET /campaigns`, a lead id from `GET /leads`.
* Send `X-Request-Id` to have your own id echoed back. Otherwise the server generates one.

### Idempotency

Write endpoints accept an `Idempotency-Key` header of 8 to 128 characters of your choosing. Repeating a call with the same key replays the first result instead of acting again, so a retry after a timeout never sends twice.

```bash theme={null}
curl -X POST https://app.leadbeast.io/api/v1/inbox/$CONVERSATION_ID/reply \
  -H "Authorization: Bearer $LEADBEAST_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-$CONVERSATION_ID-2026-09-02" \
  -d '{"body": "Thanks for the reply, happy to walk you through it on Thursday."}'
```

A replayed response carries `"replayed": true` in `meta`.

## Responses

Every response is one of two shapes.

```json theme={null}
{
  "data": { "status": "queued", "message_id": "…", "conversation_id": "…" },
  "meta": { "request_id": "…", "replayed": false }
}
```

```json theme={null}
{
  "error": {
    "status": "action_required",
    "reason_code": "insufficient_scope",
    "message": "This API key does not have the 'inbox:write' scope, which this tool requires."
  },
  "meta": { "request_id": "…" }
}
```

`data.status` says what happened to the work. `completed` means done. `queued` means the work went to the sending queue, so read the conversation or campaign again to see delivery. The other values, the `reason_code` list and the HTTP codes are on [Errors and limits](https://www.leadbeast.io/docs/api-reference/errors.md).

### Pagination

List endpoints take `limit` (1 to 100, default 20) and `page` (default 1). They return `items`, `total` and `next_page`. `next_page` is `null` on the last page.

## Activity

Settings > MCP / API > Activity lists every call with the endpoint, the key that made it, and its status.


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