Skip to content

API reference

Relationship CRM API

The conversations and negotiations between a brand and its affiliates, from your own systems: threads and messages, commission offers (accept, reject, counter), your address book, tasks and reminders, and your recruitment pipeline. The same rules apply as in your console. New endpoints under /api/v1; nothing existing changes.

Keys and scopes

  • An affiliate key calls /v1/affiliate/crm/… and sees its own account's threads with brands.
  • A brand key calls /v1/advertiser/crm/… and sees its own brand's threads with affiliates.

Reading needs crm:read; every change needs crm:write. A brand key accepting an offer also needs terms:write, because accepting changes the affiliate's commission. Grant the scopes from your console's API keys page. Another account's thread, offer or contact answers 404, exactly as a missing one.

Identifiers

Every id is a whole number: thread_id, offer_id, message_id, contact_id, task_id, entry_id, document_id, group_id, brand_id (the brand's account number) and affiliate_id (the affiliate's account number).

Offer terms

An offer names the terms of a private commission group of the brand. When the offer is accepted, the affiliate joins that group, from start_date to end_date when given (ISO 8601 calendar dates, such as 2026-12-31). terms is one of:

  • {"model": "rate", "rate_kind": "pct", "rate_pct": 12} — a percentage of the sale;
  • {"model": "rate", "rate_kind": "flat", "rate_flat": 5, "currency": "EUR"} — a flat amount per sale, in a stated currency (required: there is no default currency);
  • {"model": "split", "split_pct": 70} — for a brand inside a network, the share of the commission the affiliate keeps;
  • {"model": "group", "group_id": 7} — an existing private group of the brand.

Errors

400 invalid_parameter
{
  "error": {
    "code": "invalid_parameter",
    "message": "Unrecognised body field: \"colour\". …",
    "request_id": "req_…"
  },
  "parameter": "colour"
}
400invalid_parameterA path id that is not a positive whole number, an unknown query parameter or body field (named in the message), or a value the operation refuses.
401unauthorizedNo key, or an invalid or expired one.
403insufficient_scopeThe key lacks the scope the endpoint needs (crm:read, crm:write; terms:write to accept on a brand key).
403forbiddenThe act is not yours to take, such as deciding an offer you made yourself.
404not_foundThe thread, offer, contact, task or entry does not exist, or is not your account's. The two answer the same.
409conflictThe offer is no longer open, or the change conflicts with the current state.
429rate_limitedOver the key's rate limit; see Retry-After.

Endpoints

Paths are shown after the prefix (/v1/affiliate/crm or /v1/advertiser/crm). The paths, bodies and answers are the same for both keys, except that an affiliate key names a brand with brand_id where a brand key names an affiliate with affiliate_id. A query parameter or body field not listed is refused by name. The pipeline's kind is affiliates (a brand key's default) or brands (an affiliate key's default). Examples use https://api.example.com/api and a brand key; use your own API host.

EndpointScopeWhat it does
GET /threadscrm:readEvery thread of the key's account, newest activity first
POST /threadscrm:writeOpen the thread with a brand (affiliate key) or an affiliate (brand key), or return the existing one
GET /threads/{thread_id}crm:readOne thread: its messages, its offers with their history, and its documents
POST /threads/{thread_id}/messagescrm:writePost a message on the thread
POST /threads/{thread_id}/offerscrm:writePropose commission terms on the thread
GET /offerscrm:readEvery offer of the key's account, in every state, newest first
POST /offers/{offer_id}/acceptcrm:writeAccept an offer made to you. Accepting moves the affiliate into a private commission group of the brand (a brand key also needs terms:write)
POST /offers/{offer_id}/rejectcrm:writeReject an offer made to you
POST /offers/{offer_id}/countercrm:writeAnswer an offer made to you with new terms; the original is marked countered
POST /offers/{offer_id}/withdrawcrm:writeWithdraw an offer you made, while it is open
GET /contactscrm:readYour address book; q searches name, email and company
POST /contactscrm:writeAdd a contact
GET /contacts/{contact_id}crm:readA contact with its timeline: messages, offers, emails, notes, tasks and meetings
PATCH /contacts/{contact_id}crm:writeChange a contact
DELETE /contacts/{contact_id}crm:writeRemove a contact
GET /taskscrm:readYour tasks and reminders; status filters open, done or cancelled
POST /taskscrm:writeAdd a task or reminder, optionally on a contact or a thread
PATCH /tasks/{task_id}crm:writeChange a task, or set its status (open, done or cancelled)
GET /pipelinecrm:readYour pipeline: its stages and its entries
POST /pipeline/entriescrm:writeAdd an entry to the pipeline
PATCH /pipeline/entries/{entry_id}crm:writeMove an entry to another stage, or change its note
DELETE /pipeline/entries/{entry_id}crm:writeRemove an entry from the pipeline

GET /threads

Every thread of the key's account, newest activity first. Scope crm:read. Answers 200.

Query: none. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/threads" \
  -H "Authorization: Bearer $API_KEY"

POST /threads

Open the thread with a brand (affiliate key) or an affiliate (brand key), or return the existing one. Scope crm:write. Answers 200.

Query: none. Body: brand_id / affiliate_id.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/threads" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"affiliate_id":5001}'

GET /threads/{thread_id}

One thread: its messages, its offers with their history, and its documents. Scope crm:read. Answers 200.

Query: none. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/threads/12" \
  -H "Authorization: Bearer $API_KEY"

POST /threads/{thread_id}/messages

Post a message on the thread. Scope crm:write. Answers 201.

Query: none. Body: body.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/threads/12/messages" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"body":"Happy to talk terms for January."}'

POST /threads/{thread_id}/offers

Propose commission terms on the thread. Scope crm:write. Answers 201.

Query: none. Body: terms, start_date, end_date, expires_at, note.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/threads/12/offers" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"terms":{"model":"rate","rate_kind":"pct","rate_pct":12},"start_date":"2027-01-01","end_date":"2027-03-31","note":"Q1 boost"}'

GET /offers

Every offer of the key's account, in every state, newest first. Scope crm:read. Answers 200.

Query: none. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/offers" \
  -H "Authorization: Bearer $API_KEY"

POST /offers/{offer_id}/accept

Accept an offer made to you. Accepting moves the affiliate into a private commission group of the brand (a brand key also needs terms:write). Scope crm:write. Answers 200.

Query: none. Body: none.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/offers/34/accept" \
  -H "Authorization: Bearer $API_KEY"

POST /offers/{offer_id}/reject

Reject an offer made to you. Scope crm:write. Answers 200.

Query: none. Body: none.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/offers/34/reject" \
  -H "Authorization: Bearer $API_KEY"

POST /offers/{offer_id}/counter

Answer an offer made to you with new terms; the original is marked countered. Scope crm:write. Answers 201.

Query: none. Body: terms, start_date, end_date, expires_at, note.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/offers/34/counter" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"terms":{"model":"rate","rate_kind":"pct","rate_pct":12},"start_date":"2027-01-01","end_date":"2027-03-31","note":"Q1 boost"}'

POST /offers/{offer_id}/withdraw

Withdraw an offer you made, while it is open. Scope crm:write. Answers 200.

Query: none. Body: none.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/offers/34/withdraw" \
  -H "Authorization: Bearer $API_KEY"

GET /contacts

Your address book; q searches name, email and company. Scope crm:read. Answers 200.

Query: q. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/contacts" \
  -H "Authorization: Bearer $API_KEY"

POST /contacts

Add a contact. Scope crm:write. Answers 201.

Query: none. Body: name, email, phone, company, role_title, tags, notes, brand_id / affiliate_id.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/contacts" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ana Lopez","email":"ana@example.com","company":"Example Deals","tags":["coupons"]}'

GET /contacts/{contact_id}

A contact with its timeline: messages, offers, emails, notes, tasks and meetings. Scope crm:read. Answers 200.

Query: none. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/contacts/56" \
  -H "Authorization: Bearer $API_KEY"

PATCH /contacts/{contact_id}

Change a contact. Scope crm:write. Answers 200.

Query: none. Body: name, email, phone, company, role_title, tags, notes, brand_id / affiliate_id.

curl
curl -X PATCH "https://api.example.com/api/v1/advertiser/crm/contacts/56" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ana Lopez","email":"ana@example.com","company":"Example Deals","tags":["coupons"]}'

DELETE /contacts/{contact_id}

Remove a contact. Scope crm:write. Answers 200.

Query: none. Body: none.

curl
curl -X DELETE "https://api.example.com/api/v1/advertiser/crm/contacts/56" \
  -H "Authorization: Bearer $API_KEY"

GET /tasks

Your tasks and reminders; status filters open, done or cancelled. Scope crm:read. Answers 200.

Query: status. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/tasks" \
  -H "Authorization: Bearer $API_KEY"

POST /tasks

Add a task or reminder, optionally on a contact or a thread. Scope crm:write. Answers 201.

Query: none. Body: title, notes, due_at, contact_id, thread_id, assignee_email.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/tasks" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Follow up on the offer","due_at":"2027-01-05T09:00:00Z","thread_id":12}'

PATCH /tasks/{task_id}

Change a task, or set its status (open, done or cancelled). Scope crm:write. Answers 200.

Query: none. Body: title, notes, due_at, status, assignee_email.

curl
curl -X PATCH "https://api.example.com/api/v1/advertiser/crm/tasks/78" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"done"}'

GET /pipeline

Your pipeline: its stages and its entries. Scope crm:read. Answers 200.

Query: kind. Body: none.

curl
curl -X GET "https://api.example.com/api/v1/advertiser/crm/pipeline" \
  -H "Authorization: Bearer $API_KEY"

POST /pipeline/entries

Add an entry to the pipeline. Scope crm:write. Answers 201.

Query: kind. Body: brand_id / affiliate_id, label, stage_key, note, contact_id.

curl
curl -X POST "https://api.example.com/api/v1/advertiser/crm/pipeline/entries" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"affiliate_id":5001,"stage_key":"contacted"}'

PATCH /pipeline/entries/{entry_id}

Move an entry to another stage, or change its note. Scope crm:write. Answers 200.

Query: kind. Body: stage_key, note.

curl
curl -X PATCH "https://api.example.com/api/v1/advertiser/crm/pipeline/entries/90" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stage_key":"negotiating"}'

DELETE /pipeline/entries/{entry_id}

Remove an entry from the pipeline. Scope crm:write. Answers 200.

Query: kind. Body: none.

curl
curl -X DELETE "https://api.example.com/api/v1/advertiser/crm/pipeline/entries/90" \
  -H "Authorization: Bearer $API_KEY"