Flows
A flow is a specific offer link the tracker sends a visitor to: an external CPA network URL, an internal landing or a Telegram channel via a bot. One offer can have several flows (different landings, geos, PWAs). In a campaign, flows are grouped into sets sets[].flows[]. In the cabinet, this is the Tracker → Offer Links section (see Offer links).
Obtaining a token, the common response format, list parameters and errors are covered in the main article of the section.
Scopes
| Scope | Access | In default PAT |
|---|---|---|
api:flows |
read: flow list and card | yes |
api:flows:write |
create and edit | no |
Endpoints
| Method | Path | Scope | RBAC permission |
|---|---|---|---|
GET |
/api/flows |
api:flows |
flow:list |
POST |
/api/flows |
api:flows:write |
flow:create |
GET |
/api/flows/{id} |
api:flows |
flow:read |
PATCH |
/api/flows/{id} |
api:flows:write |
flow:update |
All roles have all permissions. Visibility: ADMIN — all flows, TEAM_OWNER/TEAM_LEAD/TECH — team flows, BUYER — own flows and those available through access settings. Someone else's flow → 404.
List parameters for GET /api/flows
| Fields | |
|---|---|
Filters filter[...] |
_id, cpa, offer, team, user, name, hostingType, url, isActive, created, updated, tags |
Sorting sort |
name, hostingType, url, isActive, created, updated |
| Default populate | user (name, email, avatar), team (name), cpa (name), offer (name, country), tags |
# all active external flows of an offer
curl -G 'https://adset.pro/api/flows' \
-H 'Authorization: Bearer pat_…' \
--data-urlencode 'pageSize=100' \
--data-urlencode 'filter[offer]=6650f0e1d2c3b4a5f6e7d8c8' \
--data-urlencode 'filter[hostingType]=external' \
--data-urlencode 'filter[isActive]=true'
# find flows by domain in the URL
curl -G 'https://adset.pro/api/flows' \
-H 'Authorization: Bearer pat_…' \
--data-urlencode 'filter[url][contains]=partner.example'
Flow object
| Field | Type | Description |
|---|---|---|
id |
string | ObjectId |
name |
string | name (required on creation) |
description |
string | description |
isActive |
boolean | default true |
cpa |
id | { id, name } |
CPA network (required on creation) |
offer |
id | { id, name, country } |
offer (required on creation) |
hostingType |
external | internal | telegram |
where the flow leads: an external link; an internal landing from the builder; a Telegram channel with attribution via a bot. Default external |
url |
string | target URL. Required and must be valid for external; may be empty for internal and telegram. Macros go in curly braces, for example {click_id} |
landing |
id | null | landing for hostingType = internal |
refference |
id | object | null | parent flow from which the click_id mapping is taken (for linked flows) |
telegram |
object | Telegram attribution settings: { bot, channelId, welcomeMessage, attributionWindowDays, inviteLink }; attributionWindowDays — 1–7, default 2 |
user, team |
id | object | owner and team |
tags[] |
id[] | objects | tags |
created, updated |
date | read-only |
The telegram object is always present in the response, even for external flows — with empty default values.
POST /api/flows — create a flow
Required fields: name, cpa, offer. The network and the offer must be available to the token owner (otherwise 404). The team and the owner are inherited from the CPA network by default.
// POST /api/flows
{
"name": "DE — landing v1",
"cpa": "65f0a1b2c3d4e5f6a7b8c9d0",
"offer": "6650f0e1d2c3b4a5f6e7d8c8",
"hostingType": "external",
"url": "https://partner.example/offer?aff=123&sub1={click_id}",
"description": "",
"isActive": true,
"tags": []
}
Owner assignment:
| Token role | What is taken into account |
|---|---|
| ADMIN | user and team from the body if both are passed; otherwise — the owner and team of the CPA network |
| TEAM_OWNER, TEAM_LEAD, TECH | user from the body (team — from the CPA network) |
| BUYER | always becomes the owner itself |
Response — 201 Created, header Location: /flows/{id}, body — the flow object in the { data, traceId } envelope.
For hostingType = internal, pass landing (landing id); for telegram — a telegram object with bot and channelId; the invite link is generated by the bot (see Traffic attribution to Telegram channels).
PATCH /api/flows/{id} — update a flow
All fields are optional; pass only what you change — the rest is kept.
// PATCH /api/flows/6650f0e1d2c3b4a5f6e7d8c9
{
"name": "DE — landing v2",
"url": "https://partner.example/offer?aff=123&sub1={click_id}&sub2={campaign_id}",
"isActive": false,
"hostingType": "external",
"tags": ["66a0…"]
}
Other editable fields: description, refference (parent flow id or null), landing, telegram{…}, user (the owner can be changed only to a user available to the token owner).
Response 200 OK:
{
"data": {
"id": "6650f0e1d2c3b4a5f6e7d8c9",
"name": "DE — landing v2",
"description": "",
"isActive": false,
"url": "https://partner.example/offer?aff=123&sub1={click_id}&sub2={campaign_id}",
"hostingType": "external",
"refference": null,
"landing": null,
"telegram": { "bot": null, "channelId": null, "welcomeMessage": "", "attributionWindowDays": 2, "inviteLink": null },
"cpa": "65f0a1b2c3d4e5f6a7b8c9d0",
"offer": "6650f0e1d2c3b4a5f6e7d8c8",
"user": "64a0…",
"team": "64b0…",
"tags": ["66a0…"],
"created": "2026-09-20T10:00:00.000Z",
"updated": "2026-10-13T10:05:00.000Z"
},
"traceId": "01HX…"
}
Bulk replacement of the domain in flow URLs and changing the network with parameter template substitution are done in other ways: the former only in the cabinet, the latter via
PATCH /api/cpa/{id}?changeAllUrl=true.
Errors
| HTTP | When |
|---|---|
403 forbidden + Insufficient OAuth scope. Required: api:flows:write |
A PAT with default read scopes calls POST/PATCH |
404 notFound |
the flow does not exist or belongs to someone else; cpa/offer/user are not available to the token owner |
422 validationError |
name, cpa or offer is missing; hostingType is not in the list; invalid url for an external flow (Flow Url not valid in details[]); attributionWindowDays outside 1–7 |
Related articles
- Offers and CPA networks (CPA) — parent entities
- Campaigns — where flows are attached in
sets[].flows[] - Offer links and Macros (placeholders) — macros for
url
