Create a traffic source (outgoing postback destination)
POST
/api/v1/traffic-sources
const url = 'https://example.com/api/v1/traffic-sources';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Facebook Ads","postbackUrl":"https://tracker.example.com/postback?clickid={click_id}&status={status}&payout={payout}","conditions":{"statuses":["sale"],"minPayout":1.5},"isActive":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/traffic-sources \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Facebook Ads", "postbackUrl": "https://tracker.example.com/postback?clickid={click_id}&status={status}&payout={payout}", "conditions": { "statuses": [ "sale" ], "minPayout": 1.5 }, "isActive": true }'Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
name
required
string
Example
Facebook AdspostbackUrl
required
Postback URL template. Placeholders: {click_id}, {status}, {payout}, {currency}, {conversion_id}, {external_id}, {sub_id_1}..{sub_id_10}
string
Example
https://tracker.example.com/postback?clickid={click_id}&status={status}&payout={payout}conditions
object
statuses
Only send the postback when the conversion status is one of these. Statuses are Telegfy ones (after mapping the network status).
Array<string>
Example
[ "sale"]minPayout
Only send the postback when payout is >= this value
number
Example
1.5isActive
boolean
Responses
Заголовок раздела «Responses»Media typeapplication/json
object
id
required
string
name
required
string
postbackUrl
required
string
conditions
object
isActive
required
boolean
createdAt
required
string
updatedAt
required
string
Example generated
{ "id": "example", "name": "example", "postbackUrl": "example", "conditions": {}, "isActive": true, "createdAt": "example", "updatedAt": "example"}