Skip to main content

Customer Callbacks

Schedule and manage callback requests from customers. When customers request a callback, this API queues the request and connects an available agent at the scheduled time.

Create Callback Request​

POST /v4/accounts/<account_sid>/callbacks

Request Body​

{
"customer_number": "+919876543210",
"customer_name": "John Doe",
"priority": "high",
"scheduled_time": "2024-06-15T14:00:00.000Z",
"exophone": "+911234567890",
"team_id": "support_team",
"custom_field": "ticket_12345",
"max_retry": 3,
"retry_interval": 300
}

Parameters​

ParameterTypeRequiredDescription
customer_numberStringYesCustomer phone number in E.164 format
customer_nameStringNoCustomer's name
priorityStringNolow, normal (default), high
scheduled_timeStringNoISO 8601 timestamp (default: immediate)
exophoneStringYesExoPhone to use for the callback
team_idStringNoRoute to specific team
agent_idStringNoAssign to specific agent
custom_fieldStringNoApplication-specific data (e.g., ticket ID)
max_retryIntegerNoMaximum retry attempts (default: 3)
retry_intervalIntegerNoSeconds between retries (default: 300)

Example Request​

curl -X POST \
'https://ccm-api.exotel.com/v4/accounts/<account_sid>/callbacks' \
-H 'Authorization: Bearer <session_token>' \
-H 'Content-Type: application/json' \
-d '{
"customer_number": "+919876543210",
"exophone": "+911234567890",
"priority": "high",
"team_id": "support_team"
}'

Response​

{
"response": {
"code": 201,
"status": "success",
"data": {
"callback_id": "cb_abc123",
"customer_number": "+919876543210",
"status": "scheduled",
"scheduled_time": "2024-06-15T14:00:00.000Z",
"priority": "high",
"created_at": "2024-06-15T10:30:00.000Z"
}
}
}

Get Callback Details​

GET /v4/accounts/<account_sid>/callbacks/<callback_id>

Response​

{
"response": {
"data": {
"callback_id": "cb_abc123",
"customer_number": "+919876543210",
"customer_name": "John Doe",
"status": "completed",
"attempts": [
{
"attempt_number": 1,
"time": "2024-06-15T14:00:00.000Z",
"status": "no-answer",
"call_sid": null
},
{
"attempt_number": 2,
"time": "2024-06-15T14:05:00.000Z",
"status": "connected",
"call_sid": "call_xyz789",
"agent_id": "agent_001",
"duration": 180
}
]
}
}
}

List Callbacks​

GET /v4/accounts/<account_sid>/callbacks

Query Parameters​

ParameterTypeDescription
statusStringscheduled, in-progress, completed, failed, canceled
priorityStringlow, normal, high
start_dateStringFilter by date range (ISO 8601)
end_dateStringEnd date filter
limitIntegerResults per page
offsetIntegerPagination offset

Cancel Callback​

PUT /v4/accounts/<account_sid>/callbacks/<callback_id>

Request Body​

{
"status": "canceled",
"reason": "Customer resolved issue via chat"
}

Callback Status Values​

StatusDescription
scheduledCallback is queued for the scheduled time
in-progressSystem is attempting to connect agent and customer
completedCallback was successful
failedAll retry attempts exhausted
canceledCallback was manually canceled

HTTP Status Codes​

CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
404Not Found
429Rate Limited

Try It​