Calls
Following webhook events are supported for Calls.
call.initiated
Triggered when a new call has been initiated.
Sample Payload
{
"event": "call.initiated",
"account_id": uuid,
"call_app_id": uuid,
"data": {
"call_id": uuid,
"from": string,
"to": string,
"direction": string,
"start_time": string,
}
}
call.answered
Triggered when a call has been answered.
Sample Payload
{
"event": "call.answered",
"account_id": uuid,
"call_app_id": uuid,
"data": {
"call_id": uuid,
"from": string,
"to": string,
"direction": string,
"start_time": string,
"answer_time": string,
}
}
call.completed
Triggered when a call is completed.
Sample Payload
{
"event": "call.completed",
"account_id": uuid,
"call_app_id": uuid,
"data": {
"call_id": uuid,
"from": string,
"to": string,
"direction": string,
"start_time": string,
"answer_time": string,
"hangup_time": string,
"duration": integer,
}
}
call.failed
Triggered when a call has failed.
Sample Payload
{
"event": "call.failed",
"account_id": uuid,
"call_app_id": uuid,
"data": {
"call_id": uuid,
"from": string,
"to": string,
"direction": string,
"duration": integer,
"start_time": string,
"answer_time": string,
"hangup_time": string,
"failure": {
code: integer,
reason: string
}
}
}
info
The timestamp fields — namely start_time
, answer_time
, and hangup_time
— will be included in the webhooks based on the state of the call. For instance, if a call fails or completes before it's answered, the subsequent webhooks will not include the answer_time
field.