A Call is an object that represents a connection between a telephone and Twilio.
Initiates a call redirect or terminates a call
Path parameters
-
The SID of the Account that created the Call resource(s) to update.
Minimum length is
34, maximum length is34. Format should match the following pattern:^AC[0-9a-fA-F]{32}$. -
The Twilio-provided string that uniquely identifies the Call resource to update
Minimum length is
34, maximum length is34. Format should match the following pattern:^CA[0-9a-fA-F]{32}$.
Body
-
The absolute URL that returns the TwiML instructions for the call. We will call this URL using the
methodwhen the call connects. For more information, see the Url Parameter section in Making Calls. -
The HTTP method we should use when calling the
url. Can be:GETorPOSTand the default isPOST. If anapplication_sidparameter is present, this parameter is ignored.Values are
GETorPOST. -
Values are
canceledorcompleted. -
The URL that we call using the
fallback_methodif an error occurs when requesting or executing the TwiML aturl. If anapplication_sidparameter is present, this parameter is ignored. -
The HTTP method that we should use to request the
fallback_url. Can be:GETorPOSTand the default isPOST. If anapplication_sidparameter is present, this parameter is ignored.Values are
GETorPOST. -
The URL we should call using the
status_callback_methodto send status information to your application. If nostatus_callback_eventis specified, we will send thecompletedstatus. If anapplication_sidparameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). -
The HTTP method we should use when requesting the
status_callbackURL. Can be:GETorPOSTand the default isPOST. If anapplication_sidparameter is present, this parameter is ignored.Values are
GETorPOST. -
TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
-
The maximum duration of the call in seconds. Constraints depend on account and configuration.
curl \
--request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'Url=https%3A%2F%2Fexample.com&Method=GET&Status=completed&FallbackUrl=https%3A%2F%2Fexample.com&FallbackMethod=GET&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackUrl=https%3A%2F%2Fexample.com&StatusCallbackMethod=GET'
{"Url" => "https://example.com", "Method" => "GET", "Status" => "completed", "FallbackUrl" => "https://example.com", "FallbackMethod" => "GET", "StatusCallback" => "https://example.com", "StatusCallbackUrl" => "https://example.com", "StatusCallbackMethod" => "GET"}
{"Url" => "https://example.com", "Method" => "GET", "Status" => "canceled", "FallbackUrl" => "https://example.com", "FallbackMethod" => "GET", "StatusCallback" => "https://example.com", "StatusCallbackMethod" => "GET"}
{"Twiml" => "<Response><Say>Enjoy</Say></Response>", "Method" => "GET", "Status" => "canceled", "FallbackUrl" => "https://example.com", "FallbackMethod" => "GET", "StatusCallback" => "https://example.com", "StatusCallbackMethod" => "GET"}
{"TimeLimit" => 600}
{
"to": "+14158675309",
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"from": "+14158675308",
"price": "-0.03000",
"status": "completed",
"duration": "15",
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
"direction": "inbound",
"group_sid": null,
"trunk_sid": null,
"annotation": null,
"price_unit": "USD",
"queue_time": "1000",
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
"to_formatted": "(415) 867-5309",
"forwarded_from": "+141586753093",
"from_formatted": "(415) 867-5308",
"parent_call_sid": null,
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"subresource_uris": {
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json",
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json"
}
}
{
"to": "+14158675309",
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"from": "+14158675308",
"price": "-0.03000",
"status": "canceled",
"duration": "15",
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
"direction": "inbound",
"group_sid": null,
"trunk_sid": null,
"annotation": null,
"price_unit": "USD",
"queue_time": "1000",
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
"to_formatted": "(415) 867-5309",
"forwarded_from": "+141586753093",
"from_formatted": "(415) 867-5308",
"parent_call_sid": null,
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"subresource_uris": {
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json",
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json"
}
}
{
"to": "+14158675309",
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"from": "+14158675308",
"price": "-0.03000",
"status": "canceled",
"duration": "15",
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
"direction": "inbound",
"group_sid": null,
"trunk_sid": null,
"annotation": null,
"price_unit": "USD",
"queue_time": "1000",
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
"to_formatted": "(415) 867-5309",
"forwarded_from": "+141586753093",
"from_formatted": "(415) 867-5308",
"parent_call_sid": null,
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"subresource_uris": {
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json",
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json"
}
}
{
"to": "+14158675309",
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
"from": "+14158675308",
"price": "-0.03000",
"status": "canceled",
"duration": "15",
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
"direction": "inbound",
"group_sid": null,
"trunk_sid": null,
"annotation": null,
"price_unit": "USD",
"queue_time": "1000",
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"answered_by": null,
"api_version": "2010-04-01",
"caller_name": null,
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
"to_formatted": "(415) 867-5309",
"forwarded_from": "+141586753093",
"from_formatted": "(415) 867-5308",
"parent_call_sid": null,
"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"subresource_uris": {
"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",
"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",
"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",
"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",
"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json",
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json"
}
}