Adset.ProAdset.ProKnowledge base
To app

Campaigns

A campaign is the traffic entry point into the tracker: a tracking link, domain, source, flow sets (sets) with filters and weights, white page and redirect settings. Through the API you can list campaigns, read a full campaign, create new ones and edit existing ones — the same as the Tracker → Campaigns section in the cabinet (see Campaigns and flows and Campaign settings).

Getting a token, the common response format, list parameters and errors are described in the main article of the section.

Scopes

Scope Access In default PAT
api:campaigns read: campaign list and details yes
api:campaigns:write create and edit no

Endpoints

Method Path Scope RBAC permission
GET /api/campaigns api:campaigns campaigns:list
POST /api/campaigns api:campaigns:write campaigns:create
GET /api/campaigns/{id} api:campaigns campaigns:read
PATCH /api/campaigns/{id} api:campaigns:write campaigns:update

All roles have all four permissions. Visibility: ADMIN — all campaigns, TEAM_OWNER/TEAM_LEAD/TECH — the team's campaigns, BUYER — their own. Someone else's campaign → 404.

GET /api/campaigns list parameters

Fields
Filters filter[...] _id, name, isActive, status, domain, source, user, team, tags, created, updated, sets.settings.pixels
Sorting sort name, isActive, status, user, team, created, updated
Default populate user (name, email, avatar), team (name), domain (domain, status, isActive), source (name), groups (name, type), sets.flows.pwa, sets.flows.landing, sets.flows.postlanding, sets.settings.pixels, tags (name, color)

In the list, the sets.flows.cpa / offer / flow references come as string ids; in the details GET /api/campaigns/{id} they are expanded into short { id, name } objects (flow also has isActive, hostingType), and whitePageSystem is expanded as well.

# active team campaigns on a domain, by update date
curl -G 'https://adset.pro/api/campaigns' \
  -H 'Authorization: Bearer pat_…' \
  --data-urlencode 'pageSize=100' \
  --data-urlencode 'sort=updated:desc' \
  --data-urlencode 'filter[isActive]=true' \
  --data-urlencode 'filter[domain]=6650f0e1d2c3b4a5f6e7d8c9'

Campaign object

Field Type Description
id string ObjectId
name string name (required on creation)
alias string | null short identifier in the public link https://{domain}/{alias}; up to 35 characters, Latin letters and digits only, globally unique. Without an alias the campaign is available at /track/{id}/ads
isActive boolean whether the campaign is enabled (default true)
status draft | complete read-only: complete after any save
user, team id | object owner and team
sets[] array flow sets (see below)
domain id | object | null campaign domain
source id | object | null traffic source
trackingUrl string | null read-only: the ready-made tracking link
whitePageType none | url | system white page type (default none)
whitePage string | null external white page URL (for url)
whitePageSystem id | object | null system white page (for system)
backButtonEnable boolean “back” button override (default false)
disableTrackWhiteList boolean disable the tracker white-list (default false)
groups[] id[] | objects push notification groups: up to 3, no more than one system group
group id | object | null deprecated field — the first element of groups, kept for compatibility
tags[] id[] | objects tags
stickyFlow boolean stick the flow to the visitor (default false)
stickyFlowSkipInactive boolean skip a disabled sticky flow
stickyFlowKeepClickId boolean keep click_id on repeat visits
redirectMethod http | meta | js | empty_referrer | double_meta | form_submit | iframe redirect method to the target URL (default http = 302), see Traffic redirect methods
trafficPricingType CPC | CPM | CPA pricing model for incoming traffic (default CPC)
cpaPricingEvent CPA_ACCEPT | CPA_HOLD | PWA_INSTALL | null the event paid for when trafficPricingType = CPA
cpaPricingValue number | null event cost for CPA, ≥ 0
sourcePostbackSampleRate number share of conversions (0–100 %) sent to the source pixel; default 100
sourcePostbackRevenueSampleRate number share of payouts (0–300 %) sent to the source pixel; default 100
created, updated date read-only

Flow set sets[]

{
  "id": "…",                        // read-only
  "name": "main",
  "settings": {
    "pixels": ["66a0…"],            // set pixel ids (may be objects in the response)
    "enablePixelsAsJs": false,
    "applyMode": "AND",             // AND | OR — how filters are combined
    "filters": [
      { "type": "headers", "key": "user_country", "op": "IN", "values": ["DE", "AT"] }
    ]
  },
  "flows": [
    {
      "cpa": "65f0…",               // required
      "offer": "6650…",             // required
      "flow": "6650…",              // required
      "weight": 100,                // rotation weight, default 100
      "isActive": true,
      "pwa": null,                  // PWA id or null
      "pwaType": "internal",        // internal | external | ios-app
      "landing": null,              // landing id or null
      "landingAsPwa": false,
      "postlanding": null           // post-landing id or null
    }
  ]
}

Set filters: type ∈ event | headers | query | date | data, op ∈ IN | NOT_IN | BETWEEN | EXIST | NOT_EXIST, values — an array of strings. Filter keys are the same as in the UI, see Tracker campaign filter reference.

POST /api/campaigns — create a campaign

The only required field is name. The team is taken from the token; if the token owner has no team and team is not passed, 400 is returned. For an ADMIN token, team and/or user are required — otherwise 400.

// POST /api/campaigns
{
  "name": "DE — push casino",
  "alias": "depushcasino",          // optional; Latin letters and digits, ≤ 35, globally unique
  "isActive": true,
  "domain": "6650f0e1d2c3b4a5f6e7d8c9",
  "source": "6650f0e1d2c3b4a5f6e7d8c8",
  "redirectMethod": "http",
  "trafficPricingType": "CPC",
  "sets": [
    {
      "name": "main",
      "settings": { "pixels": [], "filters": [], "applyMode": "AND" },
      "flows": [
        { "cpa": "65f0a1b2c3d4e5f6a7b8c9d0", "offer": "6650f0e1d2c3b4a5f6e7d8c7", "flow": "6650f0e1d2c3b4a5f6e7d8c6" }
      ]
    }
  ],
  "tags": []
}

Rules:

  • Without sets the campaign is created empty — its traffic will go nowhere until sets are added.
  • Inside sets[].flows[] the cpa, offer, flow fields are required; pwa, landing, postlanding are optional references.
  • alias: taken by another campaign → 400 Alias already used; contains characters other than Latin letters and digits → 400 Alias may contain only latin letters and digits.
  • groups — up to 3 ids, no more than one system group.
  • user (owner) is taken into account only for roles that can assign an owner; a BUYER always becomes the owner themselves.

Response — 201 Created, header Location: /campaigns/{id}, body — the full campaign object in a { data, traceId } envelope:

{
  "data": {
    "id": "6704a1b2c3d4e5f6a7b8c9d0",
    "name": "DE — push casino",
    "alias": "depushcasino",
    "isActive": true,
    "status": "draft",
    "user": { "id": "64a0…", "name": "Buyer One", "email": "[email protected]", "avatar": null },
    "team": { "id": "64b0…", "name": "Team A" },
    "sets": [ { "id": "6704…", "name": "main", "settings": { "pixels": [], "enablePixelsAsJs": false, "filters": [], "applyMode": "AND" },
               "flows": [ { "id": "6704…", "cpa": "65f0…", "offer": "6650…", "flow": "6650…", "weight": 100, "isActive": true,
                            "pwa": null, "pwaType": "internal", "landing": null, "landingAsPwa": false, "postlanding": null } ] } ],
    "domain": { "id": "6650…", "domain": "track.example.com", "status": "active", "isActive": true },
    "source": { "id": "6650…", "name": "Facebook", "isActive": true },
    "trackingUrl": "https://track.example.com/depushcasino",
    "whitePageType": "none", "whitePage": null, "whitePageSystem": null,
    "backButtonEnable": false, "disableTrackWhiteList": false,
    "group": null, "groups": [], "tags": [],
    "stickyFlow": false, "stickyFlowSkipInactive": false, "stickyFlowKeepClickId": false,
    "redirectMethod": "http",
    "trafficPricingType": "CPC", "cpaPricingEvent": null, "cpaPricingValue": null,
    "sourcePostbackSampleRate": 100, "sourcePostbackRevenueSampleRate": 100,
    "created": "2026-10-13T10:00:00.000Z", "updated": "2026-10-13T10:00:00.000Z"
  },
  "traceId": "01HX…"
}

PATCH /api/campaigns/{id} — update a campaign

All fields are optional; pass only what you change. Response: 200 OK with the full object.

Specifics:

  • sets are replaced entirely. To change one flow, pass the full array of sets, not a delta. Flows from sets are checked for availability to the token owner.
  • status in the body is ignored — any PATCH sets the campaign to complete (a draft is considered complete after the first save).
  • A BUYER cannot change the owner: the user field is discarded for them.
  • On update, alias is validated by the same rules as on creation; an unchanged alias of an old campaign with special characters (-, _) can be passed as is.
# disable the campaign and change the redirect method
curl -X PATCH 'https://adset.pro/api/campaigns/6704a1b2c3d4e5f6a7b8c9d0' \
  -H 'Authorization: Bearer pat_…' \
  -H 'Content-Type: application/json' \
  -d '{ "isActive": false, "redirectMethod": "js" }'

Errors

HTTP When
400 validationError Invalid credentials, need teamId — the token owner has no team and team is not passed; Alias already used; Alias may contain only latin letters and digits; ADMIN did not specify team/user
403 forbidden + Insufficient OAuth scope. Required: api:campaigns:write A PAT with default read scopes calls POST/PATCH
404 notFound the campaign does not exist or belongs to another team/user
422 validationError no name, invalid enum (redirectMethod, whitePageType, trafficPricingType), sets[].flows[] without cpa/offer/flow, alias longer than 35 characters

Related articles