> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.alsona.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.alsona.com/_mcp/server.

# Introduction

Welcome to the **Alsona REST API**! Let’s walk through a quick setup to get you started.

**API version:** v1 (REST)

**Base URL:** `https://alsona.com/rest/`

In the dashboard, campaigns are called **Agents** and campaign profiles are called **prospects**. The API keeps the `campaign` and `profile` names in its paths and fields.

## Groups

| Group                | Description                                                               |
| -------------------- | ------------------------------------------------------------------------- |
| Account              | Retrieve account details                                                  |
| Agency               | Cross-account access via a single Agency API key                          |
| Campaigns            | Create, update, list, and delete outreach campaigns                       |
| Campaigns > Filters  | Define targeting rules (one filter per seat)                              |
| Campaigns > Profiles | Manage LinkedIn profiles inside campaigns and get their opportunity score |
| Campaigns > Signals  | Buying signals found for a campaign, grouped by company                   |
| Senders              | Manage the email senders on an account                                    |
| Integrations         | Connect third-party CRMs (HubSpot, Salesforce, etc.) and webhooks         |
| Inbox > Email        | Read and manage email inbox threads and messages                          |
| Inbox > LinkedIn     | Read and manage LinkedIn inbox threads and messages, and draft AI replies |
| Inbox > Labels       | Manage the labels used to organize inbox threads                          |
| Seats                | List the seats on an account and each seat's LinkedIn connections         |
| Signals              | Signal sources available to the account and their bundles                 |
| Stats                | Aggregated activity metrics (DAY / HOUR / MIN granularity)                |
| Templates            | Reusable workflow templates (group `account_workflows` by default)        |
| Logs                 | Activity logs for a profile on a seat                                     |

## Authentication

Create an API key in the dashboard under **Integrations > API Keys**. Every request sends it in the `X-API-KEY` header.

**Account key** - scoped to a single account:

```
GET https://alsona.com/rest/accounts/{account_id}/campaigns
X-API-KEY: <account_api_key>
```

**Agency key** - access any account within your agency:

```
GET https://alsona.com/rest/agency/accounts/{account_id}/campaigns
X-API-KEY: <agency_api_key>
```

The Agency key does **not** aggregate across accounts - you must specify `account_id` in the path. Both key types produce the same response for account-scoped endpoints.

To check a key and find the account it belongs to, call the base URL itself:

```
GET https://alsona.com/rest/
X-API-KEY: <api_key>
```

A key can be made **read-only** in the dashboard. It can then only send `GET` requests. Any other method returns `403`, and the base URL response includes `"read_only": true`.

## Path parameters

Some ids contain characters that are not safe in a URL, such as email addresses, email `message_id` values (`<abc@example.com>`), and LinkedIn `thread_id` values (which can end in `==`). Always URL-encode path parameters, e.g. `encodeURIComponent(thread_id)`.

## Pagination

List endpoints return one page at a time:

1. Make the initial request without `last_key`. Use `limit` to choose the page size: it defaults to 100 and goes up to 500, or 250 for seat profiles, as noted on each endpoint.
2. If the response includes a non-null `last_key`, JSON-stringify and URL-encode it, then pass it as `?last_key=<value>` in your next request.
3. Repeat until `last_key` is `null` - you have fetched all results.

A `limit` or `last_key` that is not valid returns `400`.

## Errors and rate limits

Errors use standard HTTP status codes with a `success: false` body and a `message`. Each API key can make 10 requests per second (bursts up to 20) and 250,000 requests per day. See [Response Codes](/response-codes) for the full list of status codes.