# Promoter developer API

Add LinkedIn outreach to your own product. Your users connect their LinkedIn account inside your app. You start outreach for them with one call. Promoter paces the sending and stops when someone replies.

Not affiliated with LinkedIn.

- Base URL: `https://promoter-app-asaf-katz-s-projects.vercel.app`
- Everything is JSON. Every error is `{"error":{"code":"...","message":"..."}}`.
- Machine-readable contract: `GET /api/openapi`
- SDK: https://promoter-app-asaf-katz-s-projects.vercel.app/downloads/promoter-sdk-0.1.0.tgz (`promoter-sdk`). Starter app: https://promoter-app-asaf-katz-s-projects.vercel.app/downloads/promoter-outreach-starter-0.1.0.tgz.

## Quickstart for AI assistants

Read this first if you are an AI coding assistant building on Promoter.

- Base URL: `https://promoter-app-asaf-katz-s-projects.vercel.app`. All JSON. Errors are `{"error":{"code","message"}}`.
- Auth: `Authorization: Bearer pma_...` (an app key). Server-side only. Any request with an `Origin` header is refused. Never put the key in browser code.
- The developer's users are a "customer" (a company) and a "person" (a user in it), named by the developer's own ids: 1 to 128 characters of `[A-Za-z0-9._:-]`.
- To act for a customer on workspace routes, add `X-Promoter-Customer: <customer id>` and optionally `X-Promoter-Person: <person id>`. Leave the person out for watch writes, discovery writes and the blacklist.
- Never retry a failed write automatically. Read first.
- Keep `completion_token` on the server. Only the person whose LinkedIn it is switches sending on, by their own click.
- LinkedIn's rules still apply to every connected account. Do not promise users that an account cannot be restricted.

Build an outreach tool:

```js
import { Promoter } from 'promoter-sdk';                       // server-side only
const promoter = new Promoter(process.env.PROMOTER_KEY);       // pma_... app key
const started = await promoter.connect({                       // 1. start connecting LinkedIn
  customer: { id: 'acme', name: 'Acme' }, person: { id: 'u1', name: 'Dana Example', role: 'admin' },
  returnUrl: 'https://app.example.com/linkedin/return' });     // must be registered for your app
// 2. keep started.completion_token on your server; send the browser to started.url
// 3. the browser returns to returnUrl?connection_id=...&account_ref=... (or &error=cancelled|failed|capacity)
const { account } = await promoter.completeConnection({ customerId: 'acme', personId: 'u1',
  connectionId, completionToken: started.completion_token, accountRef });
await promoter.setSending({ customerId: 'acme', personId: 'u1', accountId: account.id, enabled: true }); // the person's own click
const me = promoter.for('acme', 'u1');                         // act for that customer
await me.outreach({ name: 'Security leaders', people: ['https://www.linkedin.com/in/example-person'],
  steps: ['invite: Hi {{first_name}}', 'wait 2d', 'message: Thanks for connecting, {{first_name}}.'] });
await promoter.for('acme').watch({ prompt: 'People discussing identity security',   // no person: watches belong to the customer
  keywords: ['identity security'], buyerTitles: ['CISO', 'Head of Security'],
  campaign: { name: 'Identity signals', steps: ['invite', 'wait 1d', 'message: Hi {{first_name}}'] } });
const { replies } = await me.replies();                        // poll for replies
```

Without the SDK, the same calls are: `POST /api/apps/v1/connect`, `POST /api/apps/v1/connect/complete`, `POST /api/apps/v1/accounts/{id}/sending`, `POST /api/outreach`, `POST /api/watches`, `GET /api/app/replies`.

More: `GET /api/openapi` (every route as JSON), `GET /api/mcp/guide` (the hosted MCP server), `/developers` (guides), the SDK and the starter app (links above).md`).

## Contents

1. [How it works](#how-it-works)
2. [Pricing and switching your app on](#pricing-and-switching-your-app-on)
3. [Authentication](#authentication)
4. [Quickstart with curl](#quickstart-with-curl)
5. [Quickstart with the SDK](#quickstart-with-the-sdk)
6. [A. App routes](#a-app-routes)
7. [B. Acting for a customer](#b-acting-for-a-customer)
8. [Outreach](#outreach)
9. [Campaigns, replies and activity](#campaigns-replies-and-activity)
10. [Watches](#watches)
11. [Errors](#errors)
12. [What the platform enforces](#what-the-platform-enforces)
13. [Limits](#limits)
14. [For Promoter's own customers](#for-promoters-own-customers)

## How it works

Three names matter.

- **App**: your product. It has one secret key (`pma_...`), a list of return addresses and a sender limit.
- **Customer**: one company in your product. You name it by your own id. Each customer gets its own isolated workspace in Promoter.
- **Person**: one user of that customer. You name them by your own id. A person has a role: `admin` or `operator`.

Your ids are 1 to 128 characters of `[A-Za-z0-9._:-]`. Names are 1 to 120 characters. Customers and people are created the first time you connect them. There is nothing to set up beforehand.

Your users never see Promoter and never get a Promoter login.

The flow:

1. Your server calls **connect**. It gets a hosted address and a completion token.
2. You send the person's browser to the hosted address. They sign in to LinkedIn there.
3. The browser returns to your return address. Your server calls **complete**.
4. The person switches **sending** on.
5. Your server calls **outreach** or creates a **watch** for that customer.

## Pricing and switching your app on

- $10 per connected LinkedIn account per month, for developers building on the API.
- A workspace owner creates the app and its key in Promoter under Settings. The key is shown once. Creating a new key replaces the old one at once.
- Promoter staff set your app's sender limit. It starts at 0. Ask us to switch your app on.
- Self-serve billing for apps is not built yet.
- The sender limit is one number for your whole app, across all your customers.

## Authentication

Send your app key from your server:

```
Authorization: Bearer pma_...
```

- Server-side only. Any request with an `Origin` header is refused with 403 `browser_forbidden`.
- Credentials in the query string are refused with 400 `query_credentials_forbidden`.
- 300 requests a minute per app. After that: 429 `app_rate_limited`.
- The key has no expiry. It stops working if the app's workspace no longer has a verified owner.
- Do not send a workspace header with an app key. It is refused with 400 `invalid_workspace_header`.

There are two kinds of route:

- **A. App routes** under `/api/apps/v1/`. The key alone. Customer and person ids go in the body or the query.
- **B. Workspace routes** such as `/api/outreach`. The key plus the header `X-Promoter-Customer`.

## Quickstart with curl

Set your key first. The examples use the made-up ids `acme` and `u1`.

```sh
export PROMOTER_KEY=...   # your pma_ key
export BASE=https://promoter-app-asaf-katz-s-projects.vercel.app
```

1. Start a connection.

```sh
curl -sS -X POST "$BASE/api/apps/v1/connect" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "Content-Type: application/json" \
  -d '{"customer":{"id":"acme","name":"Acme"},
       "person":{"id":"u1","name":"Dana Example","role":"admin"},
       "return_url":"https://app.example.com/linkedin/return"}'
```

Keep `completion_token` on your server. Send the person's browser to `url`.

2. The browser returns to `https://app.example.com/linkedin/return?connection_id=...&account_ref=...`. Complete it.

```sh
curl -sS -X POST "$BASE/api/apps/v1/connect/complete" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "Content-Type: application/json" \
  -d '{"customer_id":"acme","person_id":"u1","connection_id":"CONNECTION_ID",
       "completion_token":"COMPLETION_TOKEN","account_ref":"ACCOUNT_REF"}'
```

3. Switch sending on, when the person asks for it.

```sh
curl -sS -X POST "$BASE/api/apps/v1/accounts/ACCOUNT_ID/sending" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "Content-Type: application/json" \
  -d '{"customer_id":"acme","person_id":"u1","enabled":true}'
```

4. Start outreach for that customer.

```sh
curl -sS -X POST "$BASE/api/outreach" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "Content-Type: application/json" \
  -H "X-Promoter-Customer: acme" -H "X-Promoter-Person: u1" \
  -d '{"name":"Security leaders",
       "people":["https://www.linkedin.com/in/example-person"],
       "steps":[{"type":"connection_request","note":"Hi {{first_name}}"},
                {"type":"wait","duration":{"value":2,"unit":"days"}},
                {"type":"message","text":"Thanks for connecting, {{first_name}}."}]}'
```

5. Read the replies.

```sh
curl -sS "$BASE/api/app/replies" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "X-Promoter-Customer: acme" -H "X-Promoter-Person: u1"
```

## Quickstart with the SDK

```js
import { Promoter } from 'promoter-sdk';

const promoter = new Promoter(process.env.PROMOTER_KEY);

const started = await promoter.connect({
  customer: { id: 'acme', name: 'Acme' },
  person: { id: 'u1', name: 'Dana Example', role: 'admin' },
  returnUrl: 'https://app.example.com/linkedin/return',
});
// Keep started.completion_token on your server. Send the browser to started.url.

// On your return route:
const { account } = await promoter.completeConnection({
  customerId: 'acme', personId: 'u1', connectionId, completionToken, accountRef,
});
await promoter.setSending({ customerId: 'acme', personId: 'u1', accountId: account.id, enabled: true });

const me = promoter.for('acme', 'u1');
await me.outreach({
  name: 'Security leaders',
  people: ['https://www.linkedin.com/in/example-person'],
  steps: ['invite: Hi {{first_name}}', 'wait 2d', 'message: Thanks for connecting, {{first_name}}.'],
});
const { replies } = await me.replies();
```

The SDK's README lists every call. The starter app is a complete small example.

## A. App routes

The key alone. No `X-Promoter-*` headers. Unknown fields are refused with 422 `invalid_request`.

### POST /api/apps/v1/connect

Starts connecting one person's LinkedIn account.

| Field | Type | Notes |
|---|---|---|
| `customer` | `{id, name}` | Required. Created on first use. |
| `person` | `{id, name, role}` | Required. `role` is `admin` or `operator`. A role sent again replaces the earlier one. |
| `return_url` | string | Required. Must equal one of your app's registered return addresses exactly. https, up to 500 characters, no query, no fragment. |
| `sales_navigator` | boolean | Optional. Also connect Sales Navigator. |
| `reconnect_account_id` | uuid | Optional. Reconnect an account this person connected before. |

Replies:

- **200** `{connection_id, url, expires_at, completion_token}`. Send the person's browser to `url`. Keep `completion_token` on your server, bound to your own signed-in user. The link works until `expires_at`, 15 minutes today.
- **202** `{status: "sender_limit_reached"}`. Your app has no free seat. Nothing was created.

The hosted page returns the browser to `return_url` with:

- `?connection_id=...&account_ref=...` on success. Nothing is registered until you call complete.
- `?connection_id=...&error=cancelled`, `error=failed` or `error=capacity` otherwise.

Starting again: a new connect by the same person replaces their own connection that was not completed. The old link then returns `error=failed`. One new connection at a time per customer.

Reconnecting switches that account's sending off. It stays off once completed.

Errors: 403 `viewer_cannot_connect`, 403 `app_suspended`, 404 `account_not_found` (reconnecting an account that is not this person's), 409 `connection_in_progress`, 409 `sender_busy`, 409 `provider_account_capacity_full`, 422 `app_return_address_unknown`, 422 `invalid_request`.

### POST /api/apps/v1/connect/complete

Finishes a connection. Call it only after checking that your signed-in user is the one who started.

Body: `{customer_id, person_id, connection_id, completion_token, account_ref}`. All required. `account_ref` is the value from the return address.

Reply: **200** `{account}`. Safe to repeat. Sending stays off.

```json
{"account": {"id": "uuid", "name": "Dana Example", "status": "connected",
             "sending_enabled": false, "own": true, "needs_reconnect": false}}
```

Errors, by what to do:

| What to do | Status and code |
|---|---|
| Try again shortly | 409 `provider_account_not_ready`, 409 `provider_inventory_unverified`, 409 `provider_inventory_incomplete`, any 503 |
| No seat is free | 409 `connection_capacity_full`, 409 `account_limit_reached`, 409 `provider_account_capacity_full` |
| Start a new connection | 409 `connection_state_invalid_or_consumed`, 409 `provider_account_already_registered`, 409 `provider_account_scope_mismatch`, 404 `connection_not_found` |
| Ask Promoter | 409 `provider_unregistered_account_requires_review` |
| Other | 403 `app_suspended`, 404 `customer_not_found`, 404 `person_not_found`, 422 `invalid_request` |

### GET /api/apps/v1/accounts?customer_id=&person_id=

The customer's LinkedIn accounts.

```json
{"accounts": [{"id": "uuid", "name": "Dana Example", "status": "connected",
               "sending_enabled": true, "own": true, "needs_reconnect": false}],
 "senders": {"used_by_app": 1, "limit": 3}}
```

- `own` marks the accounts this person connected. Leave `person_id` out to read the customer's accounts with none marked `own`.
- `status` is `connected`, `needs_reconnect` or `unavailable`.
- `senders` counts your whole app.
- Before the first connect, and after removal, this answers 404 `customer_not_found` or 404 `person_not_found`. Treat only those two as "not connected".

### POST /api/apps/v1/accounts/{id}/sending

Switches sending on or off for one account.

Body: `{customer_id, person_id, enabled}`.

- Only the person whose LinkedIn it is may switch sending **on**.
- An admin may switch another person's account **off**.
- Leave `person_id` out only to switch **off** for the customer, after your own permission check.

Reply: **200** `{account}`.

Errors: 403 `sender_owner_required`, 403 `app_suspended`, 404 `account_not_found`, 402 with the reason as the code (such as `account_limit_reached`), 409 `sending_disabled`, 409 `sender_unavailable`, 409 `sender_active_elsewhere`, 409 `sender_reconnecting`, 422 `invalid_request`.

### DELETE /api/apps/v1/people/{person_id}?customer_id=

Removes a person. They lose access, their senders stop, and any connection of theirs that was not completed is void.

Reply: **200** `{removed: true}`. Safe to repeat. Connecting the same person id again brings them back, with sending off. The senders of a removed person still count toward your sender limit.

### When your app is suspended

A suspended app cannot start connections, complete them or switch sending on. Reading accounts, switching sending off and removing people still work.

## B. Acting for a customer

Use the same key on the workspace routes, with one or two extra headers:

```
Authorization: Bearer pma_...
X-Promoter-Customer: acme
X-Promoter-Person: u1
```

- `X-Promoter-Customer` is required. It is your id for the customer.
- `X-Promoter-Person` is optional. With it, you act as that person, with that person's role. Without it, you act as the customer itself.
- **Owner-only routes need the customer itself.** Leave `X-Promoter-Person` out for: creating, changing, running and deleting watches, starting and controlling discovery jobs, and the blacklist. With a person named, those answer 403 `owner_required`.
- The customer and the person must already exist. They are created by connect. Otherwise: 404 `customer_not_found` or 404 `person_not_found`.

An app key without `X-Promoter-Customer`, or on a route not listed below, is refused with 401 `credential_invalid`.

Routes an app key may use:

| Routes | Notes |
|---|---|
| `POST /api/outreach` | One call: a campaign with its people, started. |
| `/api/campaigns*` | List, read, create, edit, state, people, actions. |
| `/api/watches*` | See [Watches](#watches). Writes are owner-only. |
| `/api/leads*` | People enrolled in campaigns. |
| `/api/library*`, `/api/library-lists*` | The customer's saved people and lists. |
| `/api/discovery*` | Background imports. Writes are owner-only. |
| `/api/imports*` | CSV preview, staging and commit. Not Sales Navigator imports. |
| `GET /api/accounts`, `GET /api/accounts/{id}` | The customer's LinkedIn accounts with limits and sending hours. |
| `GET /api/app`, `GET /api/app/replies`, `GET /api/app/activity` | Overview, recent replies, recent actions. |
| `GET /api/access` | Who you are acting as. |
| `GET /api/operations` | The most recent sending runs for the customer. |
| `/api/blacklist` | Owner-only. |
| `/api/workspace/profile` | The customer's business details. |

Connecting accounts, switching sending on, billing and team membership are not on this list. Use the app routes in section A for those.

The full shape of every workspace route is in `GET /api/openapi`. This document covers the ones you need for outreach.

## Outreach

### POST /api/outreach

Creates a campaign with its people and starts it.

| Field | Type | Notes |
|---|---|---|
| `name` | string | Required. Up to 120 characters. |
| `people` | array | Required. 1 to 1000. Each is a LinkedIn profile address, or an object (below). The same profile may not appear twice. |
| `steps` | array | Required. 1 to 20 steps (below). |
| `account_id` | uuid | Optional when exactly one of the customer's accounts has sending on. Required otherwise. |
| `start` | boolean | Optional. Default `true`. `false` leaves the campaign as a draft. |

A person as an object:

```json
{"linkedin_url": "https://www.linkedin.com/in/example-person",
 "first_name": "Sam", "last_name": "Example", "company_name": "Example Co",
 "job_title": "Head of Security", "location": "Berlin", "display_name": "Sam Example"}
```

Only `linkedin_url` is required. It must be a `linkedin.com/in/...` address. Send only facts you know. Nothing is guessed.

Reply: **201** `{campaign, started}`.

### Steps

A linear list. Each step is one of:

| Step | Shape | Rules |
|---|---|---|
| Invite | `{"type":"connection_request","note":"Hi {{first_name}}"}` | Must be first if present. At most one. `note` is optional, up to 300 characters. |
| Wait | `{"type":"wait","duration":{"value":2,"unit":"days"}}` | `unit` is `minutes`, `hours` or `days`. From 5 minutes to 90 days, in steps of 5 minutes. A day is 24 hours. |
| Message | `{"type":"message","text":"Thanks, {{first_name}}."}` | Up to 8000 characters. |

A sequence must send at least one thing. A list of waits alone is refused.

Notes and messages may use these six fields: `{{first_name}}`, `{{last_name}}`, `{{display_name}}`, `{{company_name}}`, `{{job_title}}`, `{{location}}`.

A message is sent only to a confirmed connection. While an invite is pending, the message waits. A person who is not connected and has no pending invite is held for review.

Errors: 422 `invalid_request` (missing `people`, a non-boolean `start`, `contacts` used instead of `people`), 422 `validation_failed` with `details: [{path, message}]` (a bad address, a bad step), 422 `account_required` (no account with sending on, or more than one and no `account_id`), 404 `account_not_found`, 402 with the reason as the code when the account may not start, 409 `sending_disabled`.

## Campaigns, replies and activity

### GET /api/campaigns

Lists campaigns, newest first. Query: `limit` (1 to 100, default 25), `offset`.

Reply: `{campaigns: [...], pagination: {limit, offset, total, has_more}}`. A campaign has `id`, `account_id`, `name`, `state`, `steps`, `reply_policy`, `created_at`, `updated_at`.

### GET /api/campaigns/{id}

Reply: `{campaign, enrollments, actions, queue_status, step_progress}`.

- `enrollments`: the people, each with `state`, `next_step` and `next_action_at`.
- `actions`: what was sent or attempted.
- `queue_status`: what is waiting and why.

This is a bounded view. For complete lists, page through `GET /api/campaigns/{id}/leads` and `GET /api/campaigns/{id}/actions`.

Error: 404 `campaign_not_found`.

### POST /api/campaigns/{id}/state

Body: `{"state": "running"}`, `{"state": "paused"}` or `{"state": "stopped"}`.

Reply: `{campaign}`. Starting applies the same checks as outreach. Error: 422 `invalid_state`.

### POST /api/campaigns/{id}/leads

Adds people. Body: `{"contacts": [{"linkedin_url": "...", "first_name": "..."}]}`. 1 to 1000 objects, in the same shape as a person above. Plain strings are not accepted here.

Reply: **201**. People already in the campaign and people on the blacklist are left out.

### GET /api/app/replies

The 25 most recent replies.

```json
{"replies": [{"id": "uuid", "campaign_id": "uuid", "campaign_name": "Security leaders",
              "recipient_name": "Sam Example", "replied_at": "2030-01-02T03:04:05.000Z"}],
 "has_more": false}
```

### GET /api/app/activity

The 10 most recent finished actions.

```json
{"activity": [{"id": "uuid", "campaign_id": "uuid", "campaign_name": "Security leaders",
               "type": "connection_request", "state": "sent",
               "created_at": "...", "completed_at": "..."}]}
```

`state` is `sent`, `failed`, `ambiguous` or `skipped`.

## Watches

A watch is a standing search. It finds LinkedIn posts whose audience is your buyer, and adds those people to a campaign.

How it works:

1. A few times a day, the watch searches LinkedIn posts for one of its keywords. It reads through the customer's own connected account.
2. For each post, it samples the people who reacted. It counts those whose headline matches one of `buyer_titles`. That share is the post's `buyer_share`.
3. People whose headline reads like a seller, a recruiter or a job seeker are always excluded. `default_exclude_words` in the list reply shows the built-in words. `exclude_words` adds your own.
4. A post below `min_buyer_share` is skipped.
5. When `outreach` is on, only the matching people from the posts that pass are added to the campaign, up to `daily_people` a day.

A watch only reads. The campaign does the sending, under the same pacing as any campaign.

Reading watches works as a person. **Creating, changing, running and deleting a watch needs the customer itself: leave `X-Promoter-Person` out.**

### POST /api/watches

| Field | Type | Notes |
|---|---|---|
| `name` | string | Required. 1 to 120 characters. |
| `prompt` | string | Optional. What you are looking for, in your words. Up to 1000 characters. |
| `keywords` | string[] | Required. 1 to 5 phrases, each up to 80 characters. |
| `buyer_titles` | string[] | Required. 1 to 30 phrases, each up to 80 characters. |
| `exclude_words` | string[] | Optional. Up to 40 phrases. |
| `min_buyer_share` | number | Optional. 0 to 1. Default 0.1. |
| `daily_people` | integer | Optional. 1 to 50. Default 10. |
| `account_id` | uuid | Optional when the customer has exactly one LinkedIn account. |
| `campaign_id` | uuid | Optional. An existing campaign that sends through the same account. |
| `campaign` | `{name, steps}` | Optional. Creates the campaign inline. Not together with `campaign_id`. |
| `outreach` | boolean | Optional. Default `false`. Default `true` when `campaign` is given inline. |

With `campaign` given inline, the campaign is created as a draft. It starts when the first people arrive.

With no campaign, the watch only finds and scores posts. Switching `outreach` on needs a campaign.

Reply: **201** `{watch}`.

```sh
curl -sS -X POST "$BASE/api/watches" \
  -H "Authorization: Bearer $PROMOTER_KEY" -H "Content-Type: application/json" \
  -H "X-Promoter-Customer: acme" \
  -d '{"name":"Identity security",
       "prompt":"People discussing identity security",
       "keywords":["identity security","zero trust"],
       "buyer_titles":["CISO","Head of Security"],
       "campaign":{"name":"Identity signals",
                   "steps":[{"type":"connection_request"},
                            {"type":"wait","duration":{"value":1,"unit":"days"}},
                            {"type":"message","text":"Hi {{first_name}}"}]}}'
```

Errors: 422 `invalid_request`, 422 `account_required`, 404 `watch_account_not_found`, 404 `watch_campaign_not_found`, 422 `watch_campaign_required`, 409 `watch_count_reached` (20 watches per customer), 422 `validation_failed` (the inline campaign's steps).

### GET /api/watches

Reply: `{watches: [...], default_exclude_words: [...]}`.

A watch has `id`, `name`, `prompt`, `account_id`, `campaign_id`, `min_buyer_share`, `daily_people`, `outreach`, `state`, `people_added` and `people_added_today`.

### GET /api/watches/{id}

Reply: `{watch, posts}`. `posts` holds up to 100 posts, newest first.

| Field | Meaning |
|---|---|
| `post_url` | The post. |
| `author_name`, `excerpt` | Who wrote it and how it starts. |
| `reactions` | How many reactions the post had when found. |
| `sampled` | How many people were looked at. |
| `buyers` | How many of them match `buyer_titles`. |
| `buyer_share` | `buyers / sampled`, 0 to 1. Empty until the post is scored. |
| `state` | `found` (waiting to be scored or used), `skipped`, or `used`. |
| `reason` | Why: `too_few_people`, `low_buyer_share`, `outreach_off`, `daily_limit`, `nobody_new`, or empty. |
| `people_added` | How many people from this post were added to the campaign. |

Error: 404 `watch_not_found`.

### PUT /api/watches/{id}

Send only what changes: `state` (`running` or `paused`), `outreach`, `campaign_id` (or `null` to clear it), `name`, `prompt`, `keywords`, `buyer_titles`, `exclude_words`, `min_buyer_share`, `daily_people`, `account_id`.

Reply: `{watch}`. Error: 422 `invalid_request` when nothing is sent or a field is wrong.

### POST /api/watches/{id}/run

Searches now. Body: `{}`. At most every 10 minutes per watch.

Reply: `{result, watch, posts}`.

Errors: 429 `watch_ran_recently`, 409 `watch_paused`, 409 `watch_busy`.

### DELETE /api/watches/{id}

Reply: `{removed: true}`.

## Errors

Every error has this shape:

```json
{"error": {"code": "account_required", "message": "Connect LinkedIn and switch sending on first."}}
```

A `validation_failed` error also carries `details`, a list of `{path, message}`.

Branch on `code`. Show `message`. The codes below are the ones raised in the source for the routes in this document.

| Status | Code | Meaning |
|---|---|---|
| 400 | `query_credentials_forbidden` | A credential was sent in the query string. |
| 400 | `invalid_workspace_header` | An app key was sent with a workspace header. |
| 401 | `app_key_required` | No key, or not an app key, on an app route. |
| 401 | `app_key_invalid` | The app key is wrong or no longer active. |
| 401 | `credential_invalid` | An app key without `X-Promoter-Customer`, or on a route it may not use. |
| 402 | the reason, such as `account_limit_reached` or `subscription_required` | The account may not send. |
| 403 | `browser_forbidden` | The request carried an `Origin` header. |
| 403 | `app_suspended` | Your app is suspended. |
| 403 | `viewer_cannot_connect` | A viewer cannot connect LinkedIn. |
| 403 | `sender_owner_required` | Only the person whose LinkedIn it is may do this. |
| 403 | `owner_required` | Leave `X-Promoter-Person` out for this route. |
| 403 | `read_only_member` | This person has read-only access. |
| 404 | `not_found` | No such route. |
| 404 | `customer_not_found`, `person_not_found` | Not created yet, or removed. |
| 404 | `connection_not_found` | Wrong token or person, replaced, or removed. |
| 404 | `account_not_found` | No such LinkedIn account for this customer. |
| 404 | `campaign_not_found` | No such campaign. |
| 404 | `watch_not_found`, `watch_account_not_found`, `watch_campaign_not_found` | No such watch, account or matching campaign. |
| 409 | `connection_in_progress` | A connection is already being made for this customer. |
| 409 | `sending_disabled` | Sending is switched off on the platform. |
| 409 | `sender_reconnecting` | Finish reconnecting this account first. |
| 409 | `pause_before_editing` | Pause the campaign before editing it. |
| 409 | `watch_paused`, `watch_busy`, `watch_count_reached` | Resume it first, it is running now, or the customer has 20 watches. |
| 422 | `invalid_request` | A field is missing, unknown or the wrong type. |
| 422 | `validation_failed` | A step or a person is wrong. See `details`. |
| 422 | `account_required` | Say which account, or connect one and switch sending on. |
| 422 | `app_return_address_unknown` | `return_url` is not registered for your app. |
| 422 | `invalid_state` | Use `running`, `paused` or `stopped`. |
| 422 | `watch_campaign_required` | Choose a campaign before switching outreach on. |
| 429 | `app_rate_limited` | More than 300 requests in a minute. |
| 429 | `watch_ran_recently` | This watch ran in the last 10 minutes. |
| 503 | `app_access_unavailable`, `watch_unavailable`, `replies_unavailable`, `activity_unavailable` | Temporary. Try again shortly. |

The connect and complete routes also return the 409 codes listed under each route above.

### Uncertain results

A 503, a timeout, or a reply you cannot read after a **write** means the result is unknown. Do not repeat the write blindly. Read the accounts or the campaign first.

Connect, complete and remove are safe to repeat. Outreach is not: a repeated outreach call creates a second campaign. Read `GET /api/campaigns` before you repeat it.

A 429 may carry a `Retry-After` header in seconds. Wait at least a minute when it does not.

## What the platform enforces

You do not build these. They apply to every campaign, however it was started.

- **Daily limits** for each LinkedIn account, for invites and for messages.
- **Sending hours** and the account's time zone.
- **Spacing** between one action and the next.
- **Stop on reply.** Outreach stops for a person as soon as they reply.
- **No double sends.** The same step is never sent to the same person twice. An action with an uncertain outcome is marked `ambiguous` and held for review. It is not repeated.
- **The blacklist.** A blacklisted profile is never contacted by any campaign of that customer.
- **Sending is off by default.** A newly connected or reconnected account does not send until its owner switches sending on.
- **Isolation.** Each customer has its own workspace. Your key reaches only your own customers.
- **Watches exclude non-buyers.** Sellers, recruiters and job seekers are always left out.

Because of pacing, a campaign does not send everything at once. `queue_status` on a campaign says what is waiting.

## Limits

- LinkedIn's rules still apply to your users' accounts. Pacing lowers the risk of a restriction. It does not remove it. LinkedIn may limit or restrict an account at any time. Tell your users.
- 300 requests a minute per app.
- 1 to 1000 people per outreach call or add-people call.
- 1 to 20 steps per sequence. An invite note has up to 300 characters. A message has up to 8000.
- A wait is 5 minutes to 90 days.
- 20 watches per customer. 1 to 5 keywords, 1 to 30 buyer titles, 1 to 50 people a day per watch.
- A watch can be run by hand at most every 10 minutes.
- A hosted connection link works for 15 minutes today.
- 1 to 10 return addresses per app. https only.
- One sender limit per app, set by Promoter staff.
- No webhooks yet. Poll `GET /api/app/replies` and `GET /api/campaigns/{id}`.

## For Promoter's own customers

If you use Promoter yourself and are not building an app:

- A **workspace key** (`pmk_...`) works on the same workspace routes. Send no `X-Promoter-*` customer headers. Create the key in Promoter under API & MCP. With the SDK: `new Promoter(key).workspace()`.
- An **MCP server** is at `/mcp`. Its outreach and watch tools are `promoter_start_outreach`, `promoter_create_watch`, `promoter_list_watches`, `promoter_get_watch`, `promoter_update_watch`, `promoter_run_watch` and `promoter_delete_watch`. Setup guide: `GET /api/mcp/guide`.
