CPA networks
An affiliate network (CPA network) is a directory of the advertisers the team works with: name, payout currency, mapping of postback statuses to tracker events, postback macros and the parameter template for links. Offers and flows always belong to a CPA network. In the cabinet, this is the Tracker → Aff. Networks section (see Aff. Networks (CPA networks) and Conversion statuses and postback setup).
Getting a token, the common response format, list parameters and errors are covered in the main article of the section.
Scopes
| Scope | Access | Default in PAT |
|---|---|---|
api:cpa |
read CPA networks and CPA templates | yes |
api:cpa:write |
create and edit CPA networks | no |
Endpoints
| Method | Path | Scope | RBAC permission |
|---|---|---|---|
GET |
/api/cpa |
api:cpa |
cpa:list |
POST |
/api/cpa |
api:cpa:write |
cpa:create |
GET |
/api/cpa/{id} |
api:cpa |
cpa:read |
PATCH |
/api/cpa/{id}?changeAllUrl= |
api:cpa:write |
cpa:update |
The cpa:list, cpa:read, cpa:create permissions are granted to all roles. cpa:update is not granted to BUYER — for their token, PATCH /api/cpa/{id} returns 403 forbidden even with the api:cpa:write scope. Visibility: ADMIN — all networks, other roles — networks of their team (BUYER — their own and those available via access settings). Another team's network → 404.
List parameters for GET /api/cpa
| Fields | |
|---|---|
Filters filter[...] |
name, team, user, isActive, lastLoginAt, created, updated, tags |
Sorting sort |
name, isActive, created, updated |
| Default populate | user (name, email, avatar), team (name), tags |
curl -G 'https://adset.pro/api/cpa' \
-H 'Authorization: Bearer pat_…' \
--data-urlencode 'pageSize=100' \
--data-urlencode 'sort=name:asc' \
--data-urlencode 'filter[isActive]=true'
CPA network object
| Field | Type | Description |
|---|---|---|
id |
string | ObjectId |
name |
string | name (required on creation), up to 255 characters |
description |
string | description, up to 2000 characters |
shortName |
string | short name, up to 50 characters; incoming postbacks are recognized by it |
isActive |
boolean | defaults to true |
currency |
string | ISO code of the payout currency (USD, EUR, …), defaults to USD; revenue is converted to USD at the exchange rate |
paramTemplate |
string | a string of GET parameters appended to the URLs of this network's flows, for example sub1={click_id}&sub2={campaign_id} |
statuses |
object | mapping of the network's statuses to tracker events (see below) |
postbackMacros |
object | names of the network's postback parameters (see below) |
acceptDuplicates |
boolean | accept repeated postbacks with the same click_id and status (defaults to false) |
acceptDuplicatesFor |
string[] | events for which duplicates are allowed; defaults to ["CPA_HOLD", "CPA_ACCEPT"]; also allowed: CPA_REDEP, CPA_DECLINE, CPA_TRASH |
user, team |
id | object | owner and team |
tags[] |
id[] | objects | tags |
created, updated |
date | read-only |
statuses — status mapping
The values are strings that the network sends in the status parameter of the postback. Each field corresponds to a tracker event:
| Field | Tracker event | Default | Meaning |
|---|---|---|---|
hold |
CPA_HOLD |
hold |
registration / lead on hold |
accept |
CPA_ACCEPT |
accept |
first deposit, payout confirmed |
redep |
CPA_REDEP |
"" |
repeat deposit |
decline |
CPA_DECLINE |
decline |
declined |
trash |
CPA_TRASH |
trash |
trash registration |
postbackMacros — postback parameters
The names of the parameters in the network's postback from which the tracker takes data:
| Field | What it contains | Default |
|---|---|---|
clickId |
name of the parameter with the tracker click_id | "" |
status |
name of the parameter with the conversion status | "" |
revenue |
name of the parameter with the payout amount | "0" |
currency |
name of the parameter with the currency, or a fixed currency | "USD" |
externalId |
name of the parameter with the external conversion id (for deduplication) | "" |
POST /api/cpa — create a CPA network
Required field — name. The owner and team are taken from the token by default; ADMIN must pass team and/or user (otherwise 400). Filling in statuses and postbackMacros manually is optional — it is easier to take them from the CPA template of the network you need.
// POST /api/cpa
{
"name": "Casino Partners",
"shortName": "casinop",
"description": "Direct advertiser, payouts in EUR",
"currency": "EUR",
"paramTemplate": "sub1={click_id}&sub2={campaign_id}",
"statuses": { "hold": "lead", "accept": "sale", "redep": "redeposit", "decline": "rejected", "trash": "trash" },
"postbackMacros": { "clickId": "sub1", "status": "status", "revenue": "payout", "currency": "EUR", "externalId": "conversion_id" },
"acceptDuplicates": false,
"tags": []
}
Response — 201 Created, header Location: /cpa/{id}:
{
"data": {
"id": "6704b1c2d3e4f5a6b7c8d9e0",
"name": "Casino Partners",
"description": "Direct advertiser, payouts in EUR",
"shortName": "casinop",
"isActive": true,
"statuses": { "accept": "sale", "redep": "redeposit", "hold": "lead", "decline": "rejected", "trash": "trash" },
"postbackMacros": { "clickId": "sub1", "status": "status", "revenue": "payout", "currency": "EUR", "externalId": "conversion_id" },
"currency": "EUR",
"paramTemplate": "sub1={click_id}&sub2={campaign_id}",
"acceptDuplicates": false,
"acceptDuplicatesFor": ["CPA_HOLD", "CPA_ACCEPT"],
"user": "64a0…",
"team": "64b0…",
"tags": [],
"created": "2026-10-13T10:00:00.000Z",
"updated": "2026-10-13T10:00:00.000Z"
},
"traceId": "01HX…"
}
PATCH /api/cpa/{id} — update a CPA network
All fields are optional; pass only what you change. Response 200 OK with the full object.
Flag ?changeAllUrl=true
If the body changes paramTemplate, the flag cascades the update to the url of all flows of this CPA network:
- the network had no template — the new one is appended to the URL with
?or&; - the network had a template — its occurrence in the URL is replaced with the new one.
Without the flag, only the network itself changes, and flow URLs stay the same. Flows are updated within the visibility of the token owner.
# change the parameter template and push it to all flows of the network
curl -X PATCH 'https://adset.pro/api/cpa/6704b1c2d3e4f5a6b7c8d9e0?changeAllUrl=true' \
-H 'Authorization: Bearer pat_…' \
-H 'Content-Type: application/json' \
-d '{ "paramTemplate": "sub1={click_id}&sub2={campaign_id}&sub3={source_id}" }'
Before: https://partner.example/offer?aff=123&sub1={click_id}&sub2={campaign_id} → after: https://partner.example/offer?aff=123&sub1={click_id}&sub2={campaign_id}&sub3={source_id}.
Errors
| HTTP | When |
|---|---|
400 validationError |
An ADMIN token creates a network without team/user |
403 forbidden + Insufficient OAuth scope. Required: api:cpa:write |
the token has no write scope |
403 forbidden |
BUYER calls PATCH /api/cpa/{id} — the role does not have cpa:update |
404 notFound |
the network does not exist or belongs to another team |
422 validationError |
no name, unknown currency, an acceptDuplicatesFor value outside the list of events |
Related articles
- CPA templates — ready-made
statuses,postbackMacrosandparamTemplateof popular networks - Offers and Flows — child entities of the network
- Conversion statuses and postback setup — how the network should send postbacks
- Connecting a new CPA network from scratch
