Skip to content

API reference

Affiliate accounts API

Create affiliate accounts with every detail your console holds, and manage them afterwards: read, list, change, pause and resume, remove, and invite people. The same rules apply as in your console. New endpoints under /api/v1; nothing existing changes.

Machine-readable: OpenAPI 3.1 file.

Keys and scopes

Each kind of key calls its own prefix and sees only its own affiliates:

  • tk_ — /v1/network/affiliate-accounts. A network tenant's own key: every affiliate account of the tenant.
  • snk_ — /v1/subnetwork/affiliate-accounts. A SubNetwork operator's key: the operator's own affiliates.
  • mk_ — /v1/advertiser/affiliate-accounts. A brand's key (a single advertiser, or a brand inside a network): affiliates on its own program.

One scope per action. Grant a key only the scopes it needs, from your console's API keys page; any role allowed to issue keys can grant any of them that it holds itself.

EndpointScopeWhat it does
POST /affiliate-accountsaffiliate-accounts:createCreate an affiliate account (Idempotency-Key required)
GET /affiliate-accountsaffiliate-accounts:readList affiliate accounts (paged, filtered)
GET /affiliate-accounts/{account_id}affiliate-accounts:readOne affiliate account, with every detail
PATCH /affiliate-accounts/{account_id}affiliate-accounts:updateChange an affiliate account's details
DELETE /affiliate-accounts/{account_id}affiliate-accounts:deleteRemove an affiliate account (?dry_run=true previews)
POST /affiliate-accounts/{account_id}/suspendaffiliate-accounts:suspendPause an affiliate account, with a reason
POST /affiliate-accounts/{account_id}/resumeaffiliate-accounts:suspendResume a paused affiliate account, with a reason
GET /affiliate-accounts/{account_id}/usersaffiliate-accounts:readThe account's users and their roles
POST /affiliate-accounts/{account_id}/usersaffiliate-accounts:inviteInvite a user to the account
POST /affiliate-accounts/{account_id}/users/resend-inviteaffiliate-accounts:inviteResend a pending invitation (the owner's or a user's)

A brand key manages affiliates on its own program only, inside its own instance. A brand inside a network changes its program, commission groups, tags and note; the account itself — its details, pausing it, its users — is the network's. A single advertiser's brand manages its affiliates in full.

Idempotency

POST …/affiliate-accounts requires an Idempotency-Key header (any unique string, such as a UUID). A retry with the same key and the same body returns the first answer, with Idempotency-Replayed: true, and never creates a second account. The same key with a different body is 409 conflict. Every other change accepts the header too.

Errors

A validation error names every field that is wrong, not only the first: errors is a list of {field, code, message}, where field is a path such as properties[2].coupon_prefix and code is one of required, invalid, unknown_field, read_only, not_allowed, too_long, too_many, not_available.

422 validation_error
{
  "error": {
    "code": "validation_error",
    "message": "country: must be an ISO 3166-1 alpha-2 code, e.g. GB (and 1 more: see errors)",
    "request_id": "req_…"
  },
  "errors": [
    {
      "field": "country",
      "code": "invalid",
      "message": "must be an ISO 3166-1 alpha-2 code, e.g. GB"
    },
    {
      "field": "properties[0].name",
      "code": "invalid",
      "message": "Name is required"
    }
  ]
}
400invalid_parameterA query parameter is unknown or malformed (named in error.parameter and errors[]).
400idempotency_key_requiredPOST …/affiliate-accounts without an Idempotency-Key header.
401unauthorizedThe key is missing, invalid, expired, revoked — or of a kind this path does not take.
403insufficient_scopeThe key lacks the one scope this action needs.
403forbiddenThe act is not the key's to make, e.g. a brand inside a network changing an account-wide detail (errors[] names the field).
404not_foundNo account with that account_id in your scope (another tenant's, brand's or instance's affiliate answers the same).
409conflictA duplicate (email in your tenant, Sub-ID), a state that does not allow the act, or an Idempotency-Key reused with a different body.
422validation_errorThe body is invalid. errors[] lists EVERY field that is wrong: {field, code, message}, field a path like properties[2].coupon_prefix.
429rate_limitedOver 10/second or 3000/hour for this key. Retry after the Retry-After header.
503service_unavailableA dependency could not be read; nothing was changed. Retry.

Rate limits

10 requests a second and 3000 an hour per key. Every response carries the X-RateLimit-* headers; over the limit is 429 rate_limited with Retry-After.

Fields

What a create takes (a PATCH takes any of them except those marked create only, email and sub_id):

FieldTypeRequiredDescription
emailstring (email)Required on create (optional for a SubNetwork operator)The owner's login email. The account owner is invited to it (unless send_welcome_email is false). A SubNetwork operator may create an affiliate with no login. Not changed afterwards.
display_namestringRequired on createThe name the affiliate is shown by, kept as you chose it. At most 200 characters.
legal_namestring | nullOptionalLegal or company name (the affiliate's billing details). At most 200 characters.
first_namestring | nullOptionalThe account holder's first name. At most 100 characters.
last_namestring | nullOptionalThe account holder's last name. At most 100 characters.
notification_emailstring (email) | nullOptionalWhere notifications are sent, when not the login email.
phonesarray of {number, label}OptionalUp to 10 phone numbers (digits, spaces, + ( ) . -). The first is the profile's phone number.
imarray of {network, handle}OptionalUp to 10 instant-messaging handles. network: whatsapp, telegram, signal, skype, wechat, line, viber, discord, slack, teams, other.
websitestring (URL) | nullOptionalThe affiliate's website (http or https).
countrystring | nullOptionalISO 3166-1 alpha-2 country code, e.g. GB.
languagestring | nullOptionalPreferred language, a BCP 47 tag: en, pt-BR.
currencystring | nullOptionalPayout currency, ISO 4217: EUR.
vat_numberstring | nullOptionalVAT number, stored encrypted. At most 40 characters. Never returned: the account says only whether one is on file.
sub_idstringOptionalThe affiliate's Sub-ID (letters, digits, - and _; up to 64). Generated when left out. Fixed once issued. For every other key the Sub-ID is assigned automatically and returned. (SubNetwork operator keys only.)
propertiesarray of propertyOptionalUp to 50 promotional properties: {type, name, url, handle, store_id, description, audience_countries, audience_note, soft_click, coupon_prefix}. type is website, mobile_app, browser_extension, desktop_software, social_account, newsletter, messaging_channel or other; name is required, and the identifier the type needs (url, store_id or handle). coupon_prefix: 3-12 of A-Z 0-9 - _. On PATCH, name a property_id to change it, or add remove: true to retire it.
registration_fieldsobjectOptionalAnswers to your own registration fields, keyed by field id. Fields you made mandatory are required on create, exactly as on your sign-up form; a field hidden by its condition is not asked.
commission_groupsarray of {brand_id, group_id}OptionalUp to 50 commission groups to add the affiliate to, per brand. A brand key leaves brand_id out (its own).
programmesarray of {brand_id, state, group_id}OptionalThe affiliate's place on a brand's program. state: invited, approved, declined, removed — the brand invites, and approves, declines or removes an application or membership, as in the console. pending is set by the affiliate applying. group_id goes with approved. A brand key leaves brand_id out (its own).
payout{method, details}OptionalPayout method (paypal, bank, wise) and details (an object, stored encrypted). Accepted when you create the account, and until the owner first signs in; then they are the affiliate's to change. Never returned: the account says which method is on file and whether details are complete.
notification_preferencesobjectOptionalPer notification type, {"email": true|false, "in_app": true|false}. Always-on types cannot be switched off.
tagsarray of stringOptionalYour private tags, up to 50, each 1-40 characters, stored lower-case. Each key family keeps its own: a brand's tags are its own, never the network's.
notestring | nullOptionalYour private note about the affiliate, up to 5000 characters. Never shown to the affiliate.
statusstringOptionalactive or paused (default active). paused creates the account and pauses it with the create's reason. Afterwards, use …/suspend and …/resume. (create only.)
send_welcome_emailbooleanOptionalSend the owner their invitation (default true; for a SubNetwork operator default false, and only where your network settings let affiliates log in). (create only.)
usersarray of {email, role, full_name}OptionalUp to 20 more people to invite to the account. role: admin, full_access, basic_access, viewer, restricted_viewer. Afterwards, use POST …/users. (create only.)
reasonstringRequired on createWhy the change is made, recorded in your Activity log. Required on create, suspend, resume and delete; optional on PATCH. At most 500 characters.

What an account carries beyond them:

FieldTypeRequiredDescription
account_idintegerOptionalThe account's number (numbers only), assigned when the account is created. Every path takes it.
statusstringOptionalactive, pending, paused, declined. paused is the console's Suspended.
vat_number_on_filebooleanOptionalWhether a VAT number is stored (never the number).
payout{method, details_on_file, complete}OptionalWhich payout method is set and whether details are on file. Never the details.
tax_form{collected, form_type, status}OptionalOnly where you collect tax forms (W-9 / W-8BEN / W-8BEN-E): the form and its status (pending, submitted, verified). Read-only: the affiliate submits it.
programmesarray of {brand_id, state}Optionalstate: invited, pending, approved, declined, removed. A brand key sees its own program only.
usersarray of {email, role, status, full_name}OptionalEveryone on the account, active or invited.
incompletearray of field errorsOptionalOn create only: details that could not be applied after the account was made. Retry each with PATCH. Empty when everything applied.

Contacts arrive with the directory contacts feature and will be added here, additively, when it lands; sending contacts now is refused by name (not_available), never silently dropped.

Listing

GET …/affiliate-accounts pages by cursor (limit up to 200, next_cursor) and filters by status, country, tag, brand_id, programme_state, email, updated_since. Each row is a summary; read one account for every detail.

Webhooks

Subscribe your webhook endpoints to:

  • affiliate_account.created — An affiliate account is created with your key.
  • affiliate_account.updated — An account's details or status are changed with your key. changed_fields names what changed.
  • affiliate_account.removed — An account is removed with your key (for a brand inside a network: removed from your program).
affiliate_account.updated
{
  "account_id": 5001,
  "status": "active",
  "display_name": "Ana's Deals",
  "changed_fields": "country,tags",
  "occurred_at": "2026-12-01T09:30:00Z"
}

Endpoints

Shown with the network prefix; a SubNetwork operator calls /v1/subnetwork/… and a brand /v1/advertiser/… with the same paths and bodies. Examples use https://api.example.com/api; use your own API host.

POST /affiliate-accounts

Create an affiliate account (Idempotency-Key required). Scope affiliate-accounts:create.

curl
curl -X POST "https://api.example.com/api/v1/network/affiliate-accounts" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ana@example.com",
  "display_name": "Ana'\''s Deals",
  "legal_name": "Ana Deals Ltd",
  "first_name": "Ana",
  "last_name": "Silva",
  "country": "GB",
  "language": "en",
  "currency": "EUR",
  "phones": [
    {
      "number": "+44 20 7946 0000",
      "label": "office"
    }
  ],
  "website": "https://anadeals.example.com",
  "properties": [
    {
      "type": "website",
      "name": "Ana'\''s Deals",
      "url": "https://anadeals.example.com",
      "soft_click": true,
      "coupon_prefix": "ANA"
    }
  ],
  "programmes": [
    {
      "brand_id": 4001,
      "state": "invited"
    }
  ],
  "tags": [
    "fashion"
  ],
  "reason": "Onboarded from our CRM"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "email": "ana@example.com",
    "display_name": "Ana's Deals",
    "legal_name": "Ana Deals Ltd",
    "first_name": "Ana",
    "last_name": "Silva",
    "country": "GB",
    "language": "en",
    "currency": "EUR",
    "phones": [
      {
        "number": "+44 20 7946 0000",
        "label": "office"
      }
    ],
    "website": "https://anadeals.example.com",
    "properties": [
      {
        "type": "website",
        "name": "Ana's Deals",
        "url": "https://anadeals.example.com",
        "soft_click": true,
        "coupon_prefix": "ANA"
      }
    ],
    "programmes": [
      {
        "brand_id": 4001,
        "state": "invited"
      }
    ],
    "tags": [
      "fashion"
    ],
    "reason": "Onboarded from our CRM"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.post(
    "https://api.example.com/api/v1/network/affiliate-accounts",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "email": "ana@example.com",
      "display_name": "Ana's Deals",
      "legal_name": "Ana Deals Ltd",
      "first_name": "Ana",
      "last_name": "Silva",
      "country": "GB",
      "language": "en",
      "currency": "EUR",
      "phones": [
        {
          "number": "+44 20 7946 0000",
          "label": "office"
        }
      ],
      "website": "https://anadeals.example.com",
      "properties": [
        {
          "type": "website",
          "name": "Ana's Deals",
          "url": "https://anadeals.example.com",
          "soft_click": True,
          "coupon_prefix": "ANA"
        }
      ],
      "programmes": [
        {
          "brand_id": 4001,
          "state": "invited"
        }
      ],
      "tags": [
        "fashion"
      ],
      "reason": "Onboarded from our CRM"
    },
)
out = res.json()

GET /affiliate-accounts

List affiliate accounts (paged, filtered). Scope affiliate-accounts:read.

curl
curl -X GET "https://api.example.com/api/v1/network/affiliate-accounts" \
  -H "Authorization: Bearer $API_KEY"
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests

res = requests.get(
    "https://api.example.com/api/v1/network/affiliate-accounts",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
out = res.json()

GET /affiliate-accounts/{account_id}

One affiliate account, with every detail. Scope affiliate-accounts:read.

curl
curl -X GET "https://api.example.com/api/v1/network/affiliate-accounts/5001" \
  -H "Authorization: Bearer $API_KEY"
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests

res = requests.get(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
out = res.json()

PATCH /affiliate-accounts/{account_id}

Change an affiliate account's details. Scope affiliate-accounts:update.

curl
curl -X PATCH "https://api.example.com/api/v1/network/affiliate-accounts/5001" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "country": "PT",
  "tags": [
    "fashion",
    "vip"
  ],
  "reason": "CRM sync"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "country": "PT",
    "tags": [
      "fashion",
      "vip"
    ],
    "reason": "CRM sync"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.patch(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "country": "PT",
      "tags": [
        "fashion",
        "vip"
      ],
      "reason": "CRM sync"
    },
)
out = res.json()

DELETE /affiliate-accounts/{account_id}

Remove an affiliate account (?dry_run=true previews). Scope affiliate-accounts:delete.

curl
curl -X DELETE "https://api.example.com/api/v1/network/affiliate-accounts/5001" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Requested by the affiliate"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "reason": "Requested by the affiliate"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.delete(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "reason": "Requested by the affiliate"
    },
)
out = res.json()

POST /affiliate-accounts/{account_id}/suspend

Pause an affiliate account, with a reason. Scope affiliate-accounts:suspend.

curl
curl -X POST "https://api.example.com/api/v1/network/affiliate-accounts/5001/suspend" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Traffic quality review"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001/suspend", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "reason": "Traffic quality review"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.post(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001/suspend",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "reason": "Traffic quality review"
    },
)
out = res.json()

POST /affiliate-accounts/{account_id}/resume

Resume a paused affiliate account, with a reason. Scope affiliate-accounts:suspend.

curl
curl -X POST "https://api.example.com/api/v1/network/affiliate-accounts/5001/resume" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "Review passed"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001/resume", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "reason": "Review passed"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.post(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001/resume",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "reason": "Review passed"
    },
)
out = res.json()

GET /affiliate-accounts/{account_id}/users

The account's users and their roles. Scope affiliate-accounts:read.

curl
curl -X GET "https://api.example.com/api/v1/network/affiliate-accounts/5001/users" \
  -H "Authorization: Bearer $API_KEY"
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001/users", {
  method: "GET",
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests

res = requests.get(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001/users",
    headers={"Authorization": f"Bearer {API_KEY}"},
)
out = res.json()

POST /affiliate-accounts/{account_id}/users

Invite a user to the account. Scope affiliate-accounts:invite.

curl
curl -X POST "https://api.example.com/api/v1/network/affiliate-accounts/5001/users" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ops@anadeals.example.com",
  "role": "viewer",
  "full_name": "Ops"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001/users", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "email": "ops@anadeals.example.com",
    "role": "viewer",
    "full_name": "Ops"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.post(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001/users",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "email": "ops@anadeals.example.com",
      "role": "viewer",
      "full_name": "Ops"
    },
)
out = res.json()

POST /affiliate-accounts/{account_id}/users/resend-invite

Resend a pending invitation (the owner's or a user's). Scope affiliate-accounts:invite.

curl
curl -X POST "https://api.example.com/api/v1/network/affiliate-accounts/5001/users/resend-invite" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "ana@example.com"
}'
JavaScript
const res = await fetch("https://api.example.com/api/v1/network/affiliate-accounts/5001/users/resend-invite", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" },
  body: JSON.stringify({
    "email": "ana@example.com"
  }),
});
const out = await res.json();
if (!res.ok) console.error(out.error.code, out.errors); // errors[] names each field
Python
import requests, uuid

res = requests.post(
    "https://api.example.com/api/v1/network/affiliate-accounts/5001/users/resend-invite",
    headers={"Authorization": f"Bearer {API_KEY}", "Idempotency-Key": str(uuid.uuid4())},
    json={
      "email": "ana@example.com"
    },
)
out = res.json()