Sources API
Overview
Section titled “Overview”Traffic sources represent where your traffic comes from (ad networks, social platforms, etc.). Each source defines parameter templates, postback URLs, and cost tracking rules.
Authentication
Section titled “Authentication”All endpoints require either a JWT token or an API key (gf_...) in the Authorization header.
Endpoints
Section titled “Endpoints”| Method | Path | Scope | Description |
|---|---|---|---|
| GET | /api/v1/sources | read:sources | List all sources |
| POST | /api/v1/sources | write:sources | Create a source |
| GET | /api/v1/sources/{id} | read:sources | Get source details |
| PATCH | /api/v1/sources/{id} | write:sources | Update a source |
| DELETE | /api/v1/sources/{id} | write:sources | Delete a source |
| GET | /api/v1/sources/templates | read:sources | List source templates |
Examples
Section titled “Examples”Create a Source
Section titled “Create a Source”curl -X POST https://devcore.getghostflow.io/api/v1/sources \ -H "Authorization: Bearer gf_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "name": "Facebook Ads", "postbackUrl": "https://fb.example.com/postback?click_id={click_id}&payout={payout}" }'const response = await fetch('https://devcore.getghostflow.io/api/v1/sources', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ name: 'Facebook Ads', postbackUrl: 'https://fb.example.com/postback?click_id={click_id}&payout={payout}', }),});const source = await response.json();import requests
resp = requests.post( "https://devcore.getghostflow.io/api/v1/sources", headers={"Authorization": f"Bearer {api_key}"}, json={ "name": "Facebook Ads", "postbackUrl": "https://fb.example.com/postback?click_id={click_id}&payout={payout}", },)source = resp.json()List Sources
Section titled “List Sources”curl https://devcore.getghostflow.io/api/v1/sources \ -H "Authorization: Bearer gf_your_api_key"