Skip to Content
Developers
Lead campaigns

Change a lead campaign

Needs the campaigns:write scope. About scopes

Try it with a test key

Sends to https://api.traki.io

Test keys only. The key stays in this page while it is open and is never saved.

/v1/account/lead-campaigns/{id}

Changes the fields sent and leaves the rest. An exclusive campaign sells each lead once (422 sale_limit for a sale limit above 1). With ifVersion, a change based on an older version is refused. Archived campaigns cannot be changed.

Authorization

key
headerAuthorizationBearer <traki_account_…>

Path Parameters

id*string
Formatuuid

Request Body

application/json
  1. body
externalId?|null
name?string
Length3 <= length <= 120
vertical?string
Length2 <= length <= 80
leadTypeId?|

A lead type of the account’s catalog; the vertical then follows its label.

distribution?string

How a lead picks among the campaign’s buyers.

Value in"waterfall""round_robin""weighted""bid""all"
saleType?string
Value in"exclusive""shared"
saleLimit?integer

How many buyers a shared lead is sold to.

Range1 <= value <= 10
buyerPrice?number
Range0 <= value <= 10000
publisherPayout?number
Range0 <= value <= 10000
states?array<>

US states taken; empty takes all.

Itemsitems <= 60
returnsAllowed?boolean
returnWindowDays?integer
Range0 <= value <= 60
ifVersion?string

The version the change is based on. When the record has changed since, the change is refused with 409 version_conflict.

Match^\d{1,16}$

Response Body

Success

application/json
  1. response
id*string
Formatuuid
externalId*string|null
code*string
name*string
vertical*string
status*string
distribution*string
saleType*string
saleLimit*integer
Range-9007199254740991 <= value <= 9007199254740991
buyerPrice*string
publisherPayout*string
currency*string
buyers*array<>
publishers*array<>
version*string
createdAt*string
updatedAt*string
Example Request
curl -X PATCH 'https://api.traki.io/v1/account/lead-campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H "Authorization: Bearer $TRAKI_KEY" \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "externalId": "string",  "code": "string",  "name": "string",  "vertical": "string",  "status": "string",  "distribution": "string",  "saleType": "string",  "saleLimit": -9007199254740991,  "buyerPrice": "string",  "publisherPayout": "string",  "currency": "string",  "buyers": [    {      "buyer": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "externalId": "string",        "name": "string"      },      "priority": -9007199254740991,      "weight": -9007199254740991,      "price": "string",      "status": "string"    }  ],  "publishers": [    {      "publisher": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "externalId": "string",        "name": "string"      },      "status": "string",      "testMode": true    }  ],  "version": "string",  "createdAt": "string",  "updatedAt": "string"}