Adset.ProAdset.ProKnowledge base
To app
Home/Public HTTP API/CPA templates

CPA templates

A CPA template is an entry in the global catalog of popular affiliate networks with the status mapping, postback macros, link parameter template and registration URL already filled in. In the cabinet, a template is selected when creating an affiliate network, so that postbacks do not have to be configured manually. Via the API, templates are read-only: get the template you need and use its fields in POST /api/cpa.

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 templates (the same scope as for reading CPA networks) yes

There is no separate write scope: creating and editing templates is an administrative operation and is not part of the public API.

Endpoints

Method Path Scope RBAC permission
GET /api/cpa-templates api:cpa cpaTemplate:list
GET /api/cpa-templates/{id} api:cpa cpaTemplate:read

All roles have these permissions. The catalog is shared across the whole platform — templates have no owner or team.

List parameters for GET /api/cpa-templates

Fields
Filters filter[...] name, isActive, created, updated
Sorting sort name, isActive, created, updated
Populate none (a template has no references)
# find a template by part of its name
curl -G 'https://adset.pro/api/cpa-templates' \
  -H 'Authorization: Bearer pat_…' \
  --data-urlencode 'filter[name][contains]=1win' \
  --data-urlencode 'filter[isActive]=true'

Template object

Field Type Description
id string ObjectId
name string affiliate network name, up to 200 characters
description string description, up to 2000 characters
registrationUrl string registration link for the network
paramTemplate string GET parameter template for flow links
statuses object mapping of the network's statuses to tracker events: hold, accept, redep, decline, trash
postbackMacros object postback parameter names: clickId, status, revenue, currency, externalId
isActive boolean whether the template is active in the catalog
acceptDuplicates boolean recommended value for the network
acceptDuplicatesFor string[] recommended list of events for which duplicates are accepted
created, updated date read-only

The meaning of the statuses and postbackMacros fields is explained in detail in the article CPA networks.

Example response for GET /api/cpa-templates/{id}:

{
  "data": {
    "id": "66f1a2b3c4d5e6f7a8b9c0d1",
    "name": "1win Partners",
    "description": "Gambling / betting, payouts for FTD and redeposits",
    "registrationUrl": "https://1winpartners.example/signup",
    "paramTemplate": "sub1={click_id}&sub2={campaign_id}&sub3={source_id}",
    "statuses": { "accept": "first_deposit", "redep": "deposit", "hold": "registration", "decline": "decline", "trash": "trash" },
    "postbackMacros": { "clickId": "sub1", "status": "status", "revenue": "amount", "currency": "USD", "externalId": "player_id" },
    "isActive": true,
    "acceptDuplicates": true,
    "acceptDuplicatesFor": ["CPA_REDEP"],
    "created": "2026-01-15T09:00:00.000Z",
    "updated": "2026-09-01T12:30:00.000Z"
  },
  "traceId": "01HX…"
}

Recipe: create a CPA network from a template

  1. Find the template: GET /api/cpa-templates?filter[name][contains]=….
  2. Create a network by copying the template fields (requires the api:cpa:write scope):
curl -X POST 'https://adset.pro/api/cpa' \
  -H 'Authorization: Bearer pat_…' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "1win Partners",
    "shortName": "1win",
    "currency": "USD",
    "paramTemplate": "sub1={click_id}&sub2={campaign_id}&sub3={source_id}",
    "statuses": { "accept": "first_deposit", "redep": "deposit", "hold": "registration", "decline": "decline", "trash": "trash" },
    "postbackMacros": { "clickId": "sub1", "status": "status", "revenue": "amount", "currency": "USD", "externalId": "player_id" },
    "acceptDuplicates": true,
    "acceptDuplicatesFor": ["CPA_REDEP"]
  }'

Set your own name, currency and shortName fields — the template does not define them (check the payout currency in the network's account).

Errors

HTTP When
403 forbidden + Insufficient OAuth scope. Required: api:cpa the token is missing scope api:cpa
404 notFound no template with this id exists

Related articles