Call Tracking API
Manage tracking numbers, retrieve call logs, and control call flows programmatically. Requires calls:read and/or calls:write scopes.
List Tracking Numbers
curl https://api.affilync.com/api/call-tracking/numbers \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"data": [
{
"id": "num_s2t3u4",
"phone_number": "+18005551234",
"display_name": "Google Ads Pool - 1",
"type": "toll_free",
"status": "active",
"call_flow_id": "flow_v5w6x7",
"recording_enabled": true,
"created_at": "2026-02-15T10:00:00Z"
}
],
"meta": { "page": 1, "per_page": 20, "total": 12 }
}
Purchase a Number
curl -X POST https://api.affilync.com/api/call-tracking/numbers \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "local",
"area_code": "415",
"display_name": "SF Office Line"
}'
Response (201):
{
"id": "num_y8z9a0",
"phone_number": "+14155559876",
"type": "local",
"status": "active"
}
| Number Type | Description |
|---|---|
local | Local area code number |
toll_free | 800/888/877 toll-free number |
vanity | Custom spelled number (subject to availability) |
Get Call Logs
curl "https://api.affilync.com/api/call-tracking/calls?start_date=2026-03-01&end_date=2026-03-21" \
-H "Authorization: Bearer YOUR_TOKEN"
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
start_date | string | Filter start (YYYY-MM-DD) |
end_date | string | Filter end (YYYY-MM-DD) |
number_id | string | Filter by tracking number |
campaign_id | string | Filter by campaign |
outcome | string | qualified, unqualified, voicemail, abandoned |
page | int | Page number |
per_page | int | Results per page (max 100) |
Response (200):
{
"data": [
{
"id": "call_b1c2d3",
"tracking_number": "+18005551234",
"caller_number": "+12125551000",
"duration_seconds": 185,
"outcome": "qualified",
"campaign_id": "camp_abc123",
"affiliate_id": "aff_m6n7o8",
"source": "google_ads",
"caller_city": "New York",
"caller_state": "NY",
"recording_url": "https://api.affilync.com/api/call-tracking/calls/call_b1c2d3/recording",
"transcript_url": "https://api.affilync.com/api/call-tracking/calls/call_b1c2d3/transcript",
"sentiment": "positive",
"started_at": "2026-03-15T14:22:00Z"
}
],
"meta": { "page": 1, "per_page": 20, "total": 847 }
}
Get Call Recording
curl https://api.affilync.com/api/call-tracking/calls/call_b1c2d3/recording \
-H "Authorization: Bearer YOUR_TOKEN" \
--output recording.mp3
Returns the audio file (MP3 format).
Get Call Transcript
curl https://api.affilync.com/api/call-tracking/calls/call_b1c2d3/transcript \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"call_id": "call_b1c2d3",
"segments": [
{ "speaker": "ai", "text": "Hi, thanks for calling Acme!", "timestamp": 0.0 },
{ "speaker": "caller", "text": "I'd like to learn about your pricing.", "timestamp": 2.1 }
]
}
Manage Call Flows
| Method | Endpoint | Description |
|---|---|---|
GET | /api/call-tracking/flows | List all call flows |
POST | /api/call-tracking/flows | Create a call flow |
PATCH | /api/call-tracking/flows/{id} | Update a call flow |
DELETE | /api/call-tracking/flows/{id} | Delete a call flow |