Skip to main content

StatusCallback

StatusCallback is an asynchronous webhook mechanism that notifies your application when a call completes. Exotel sends an HTTP POST to your specified URL with call details.

How It Works​

  1. When making a call via the API, pass a StatusCallback URL parameter
  2. When the call reaches a terminal state, Exotel sends a POST request to that URL
  3. Your server receives call details including status, duration, and recording URL
caution

StatusCallback delivery may be delayed or fail due to network issues, server problems, or webhook downtime. Implement fallback logic using the Call Details API to ensure you capture all call data.

Default Parameters​

These parameters are always included in the webhook POST:

ParameterTypeDescription
CallSidStringUnique alpha-numeric call identifier
DateUpdatedDateTimeLast status update timestamp (format: YYYY-MM-DD HH:mm:ss)
StatusStringTerminal call status: completed, failed, busy, or no-answer
RecordingUrlStringCall recording URL (if recording was enabled)

Event-Specific Parameters​

When you subscribe to specific events via StatusCallbackEvents (supports terminal and answered), these additional parameters are included:

ParameterTypeDescription
EventTypeStringThe event type (e.g., terminal, answered)
DateCreatedDateTimeWhen the call was initiated
ToStringRecipient phone number
FromStringCalling phone number
PhoneNumberSidStringExoPhone identifier
StartTimeDateTimeWhen the call started
EndTimeDateTimeWhen the call ended
ConversationDurationIntegerSeconds both parties were connected
DirectionStringinbound, outbound-dial, or outbound-api
CustomFieldStringCustom data passed during the original API request
LegsArrayPer-leg attempt details with OnCallDuration and Status

Leg Information​

{
"Legs": [
{
"OnCallDuration": 41,
"Status": "completed",
"AnsweredBy": "NA"
},
{
"OnCallDuration": 32,
"Status": "completed",
"AnsweredBy": "HUMAN"
}
]
}

AnsweredBy Values​

ValueDescription
HumanAnswered by a person
MachineAnswered by voicemail/IVR
NotSureCould not determine
NANot applicable (first leg)

Leg Status Values​

Individual call legs can have the following statuses:

StatusDescription
completedLeg completed successfully
busyCalled party was busy
failedLeg failed
no-answerCalled party did not answer
canceledLeg was canceled
nullLeg was not attempted

Example Webhook Payload​

{
"CallSid": "80bfbec2d78bbbf10fb851f4fa165211",
"DateUpdated": "2024-01-15 14:30:45",
"Status": "completed",
"RecordingUrl": "https://s3-ap-southeast-1.amazonaws.com/...",
"EventType": "terminal",
"DateCreated": "2024-01-15 14:25:10",
"To": "09123456789",
"From": "09876543210",
"PhoneNumberSid": "0XXXXXX4890",
"StartTime": "2024-01-15 14:25:12",
"EndTime": "2024-01-15 14:30:45",
"ConversationDuration": 320,
"Direction": "outbound-api",
"CustomField": "order_12345",
"Legs": [
{
"OnCallDuration": 335,
"Status": "completed"
},
{
"OnCallDuration": 320,
"Status": "completed"
}
]
}

Usage Notes​

  • Additional StatusCallback fields (event-specific parameters) require both From and To parameters in the original call request
  • StatusCallbackEvents does not apply when using VoiceUrl — use the Passthru applet instead
  • Your webhook endpoint should respond with HTTP 200 to acknowledge receipt