Call Tracking API
Manage tracking numbers, retrieve call logs, and configure advanced call routing features programmatically. Requires authentication via JWT token or API key (X-API-Key).
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",
"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/search \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "local",
"area_code": "415",
"quantity": 1
}'
After searching, confirm the purchase:
curl -X POST https://api.affilync.com/api/call-tracking/numbers/purchase/confirm \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"session_id": "session_xyz",
"numbers": ["+14155559876"]
}'
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 and cost) |
Get Call Logs
curl "https://api.affilync.com/api/call-tracking/calls?page=1&limit=50" \
-H "Authorization: Bearer YOUR_TOKEN"
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
campaign_id | string | Filter by campaign |
status | string | Call status (initiated, ringing, in_progress, completed, rejected) |
conversion_status | string | Conversion status (qualified, not_qualified, pending, duplicate, fraud) |
limit | int | Results per page (max 100) |
offset | int | Pagination offset |
page | int | Page number (alternative to offset) |
Response (200):
{
"calls": [
{
"id": "call_b1c2d3",
"caller_id_number": "+12125551000",
"dialed_number": "+18005551234",
"duration": 185,
"billable_duration": 185,
"status": "completed",
"conversion_status": "qualified",
"conversion_value": 25.00,
"campaign_id": "camp_abc123",
"campaign_name": "Google Ads - March",
"brand_id": "brand_xyz",
"affiliate_id": "aff_m6n7o8",
"destination_number": "+14155551111",
"recording_url": "https://api.affilync.com/api/call-tracking/calls/call_b1c2d3/recording",
"caller_city": "New York",
"caller_region": "NY",
"caller_country": "US",
"ai_sentiment": "positive",
"ai_lead_score": 0.85,
"transcript_status": "completed",
"start_time": "2026-03-15T14:22:00Z",
"answer_time": "2026-03-15T14:22:05Z",
"end_time": "2026-03-15T14:25:05Z"
}
],
"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 in 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",
"transcript_status": "completed",
"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 }
]
}
Configure IVR & Call Flow
Manage Interactive Voice Response (IVR) systems and call routing for tracking numbers.
Get IVR Configuration
curl https://api.affilync.com/api/call-tracking/features/ivr/{tracking_number_id} \
-H "Authorization: Bearer YOUR_TOKEN"
Update IVR Configuration
curl -X PUT https://api.affilync.com/api/call-tracking/features/ivr/{tracking_number_id} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"greeting": "Welcome to Acme. Press 1 for sales, 2 for support.",
"menu_options": [
{
"digit": "1",
"action": "route",
"destination": "+14155551111"
},
{
"digit": "2",
"action": "route",
"destination": "+14155552222"
}
]
}'
Manage IVR Flow
| Method | Endpoint | Description |
|---|---|---|
GET | /api/call-tracking/features/ivr/{tracking_number_id}/flow | Get current IVR flow |
PUT | /api/call-tracking/features/ivr/{tracking_number_id}/flow | Update IVR flow |
POST | /api/call-tracking/features/ivr/{tracking_number_id}/flow/publish | Publish flow changes |
GET | /api/call-tracking/features/ivr/{tracking_number_id}/flow/versions | List flow versions |
POST | /api/call-tracking/features/ivr/{tracking_number_id}/flow/revert | Revert to previous version |
Configure Call Features
Advanced call handling options per tracking number.
| Method | Endpoint | Description |
|---|---|---|
GET | /api/call-tracking/features/call-features/{tracking_number_id} | Get call features config |
PATCH | /api/call-tracking/features/call-features/{tracking_number_id} | Update call features |
Call Features:
- Call recording (automatic, on-demand, or disabled)
- Caller ID override / spoofing
- Call transfer routing
- Business hours-based routing
- Failover number configuration
- Queue settings and hold music
Whisper Messages
Play a message to your agents before connecting the caller.
curl -X GET https://api.affilync.com/api/call-tracking/features/whisper/{tracking_number_id} \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X PUT https://api.affilync.com/api/call-tracking/features/whisper/{tracking_number_id} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"message": "Caller from Google Ads campaign. High-intent lead.",
"voice": "male"
}'