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.
| Endpoint | Scope | What it does |
|---|---|---|
| POST /affiliate-accounts | affiliate-accounts:create | Create an affiliate account (Idempotency-Key required) |
| GET /affiliate-accounts | affiliate-accounts:read | List affiliate accounts (paged, filtered) |
| GET /affiliate-accounts/{account_id} | affiliate-accounts:read | One affiliate account, with every detail |
| PATCH /affiliate-accounts/{account_id} | affiliate-accounts:update | Change an affiliate account's details |
| DELETE /affiliate-accounts/{account_id} | affiliate-accounts:delete | Remove an affiliate account (?dry_run=true previews) |
| POST /affiliate-accounts/{account_id}/suspend | affiliate-accounts:suspend | Pause an affiliate account, with a reason |
| POST /affiliate-accounts/{account_id}/resume | affiliate-accounts:suspend | Resume a paused affiliate account, with a reason |
| GET /affiliate-accounts/{account_id}/users | affiliate-accounts:read | The account's users and their roles |
| POST /affiliate-accounts/{account_id}/users | affiliate-accounts:invite | Invite a user to the account |
| POST /affiliate-accounts/{account_id}/users/resend-invite | affiliate-accounts:invite | Resend 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.
{
"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"
}
]
}| 400 | invalid_parameter | A query parameter is unknown or malformed (named in error.parameter and errors[]). |
| 400 | idempotency_key_required | POST …/affiliate-accounts without an Idempotency-Key header. |
| 401 | unauthorized | The key is missing, invalid, expired, revoked — or of a kind this path does not take. |
| 403 | insufficient_scope | The key lacks the one scope this action needs. |
| 403 | forbidden | The act is not the key's to make, e.g. a brand inside a network changing an account-wide detail (errors[] names the field). |
| 404 | not_found | No account with that account_id in your scope (another tenant's, brand's or instance's affiliate answers the same). |
| 409 | conflict | A duplicate (email in your tenant, Sub-ID), a state that does not allow the act, or an Idempotency-Key reused with a different body. |
| 422 | validation_error | The body is invalid. errors[] lists EVERY field that is wrong: {field, code, message}, field a path like properties[2].coupon_prefix. |
| 429 | rate_limited | Over 10/second or 3000/hour for this key. Retry after the Retry-After header. |
| 503 | service_unavailable | A 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):
| Field | Type | Required | Description |
|---|---|---|---|
email | string (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_name | string | Required on create | The name the affiliate is shown by, kept as you chose it. At most 200 characters. |
legal_name | string | null | Optional | Legal or company name (the affiliate's billing details). At most 200 characters. |
first_name | string | null | Optional | The account holder's first name. At most 100 characters. |
last_name | string | null | Optional | The account holder's last name. At most 100 characters. |
notification_email | string (email) | null | Optional | Where notifications are sent, when not the login email. |
phones | array of {number, label} | Optional | Up to 10 phone numbers (digits, spaces, + ( ) . -). The first is the profile's phone number. |
im | array of {network, handle} | Optional | Up to 10 instant-messaging handles. network: whatsapp, telegram, signal, skype, wechat, line, viber, discord, slack, teams, other. |
website | string (URL) | null | Optional | The affiliate's website (http or https). |
country | string | null | Optional | ISO 3166-1 alpha-2 country code, e.g. GB. |
language | string | null | Optional | Preferred language, a BCP 47 tag: en, pt-BR. |
currency | string | null | Optional | Payout currency, ISO 4217: EUR. |
vat_number | string | null | Optional | VAT number, stored encrypted. At most 40 characters. Never returned: the account says only whether one is on file. |
sub_id | string | Optional | The 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.) |
properties | array of property | Optional | Up 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_fields | object | Optional | Answers 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_groups | array of {brand_id, group_id} | Optional | Up to 50 commission groups to add the affiliate to, per brand. A brand key leaves brand_id out (its own). |
programmes | array of {brand_id, state, group_id} | Optional | The 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} | Optional | Payout 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_preferences | object | Optional | Per notification type, {"email": true|false, "in_app": true|false}. Always-on types cannot be switched off. |
tags | array of string | Optional | Your 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. |
note | string | null | Optional | Your private note about the affiliate, up to 5000 characters. Never shown to the affiliate. |
status | string | Optional | active 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_email | boolean | Optional | Send the owner their invitation (default true; for a SubNetwork operator default false, and only where your network settings let affiliates log in). (create only.) |
users | array of {email, role, full_name} | Optional | Up to 20 more people to invite to the account. role: admin, full_access, basic_access, viewer, restricted_viewer. Afterwards, use POST …/users. (create only.) |
reason | string | Required on create | Why 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:
| Field | Type | Required | Description |
|---|---|---|---|
account_id | integer | Optional | The account's number (numbers only), assigned when the account is created. Every path takes it. |
status | string | Optional | active, pending, paused, declined. paused is the console's Suspended. |
vat_number_on_file | boolean | Optional | Whether a VAT number is stored (never the number). |
payout | {method, details_on_file, complete} | Optional | Which payout method is set and whether details are on file. Never the details. |
tax_form | {collected, form_type, status} | Optional | Only 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. |
programmes | array of {brand_id, state} | Optional | state: invited, pending, approved, declined, removed. A brand key sees its own program only. |
users | array of {email, role, status, full_name} | Optional | Everyone on the account, active or invited. |
incomplete | array of field errors | Optional | On 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).
{
"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 -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"
}'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 fieldimport 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 -X GET "https://api.example.com/api/v1/network/affiliate-accounts" \
-H "Authorization: Bearer $API_KEY"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 fieldimport 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 -X GET "https://api.example.com/api/v1/network/affiliate-accounts/5001" \
-H "Authorization: Bearer $API_KEY"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 fieldimport 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 -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"
}'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 fieldimport 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 -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"
}'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 fieldimport 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 -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"
}'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 fieldimport 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 -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"
}'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 fieldimport 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 -X GET "https://api.example.com/api/v1/network/affiliate-accounts/5001/users" \
-H "Authorization: Bearer $API_KEY"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 fieldimport 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 -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"
}'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 fieldimport 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 -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"
}'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 fieldimport 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()