Initiates a call redirect
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.
-
The Twilio-provided string that uniquely identifies the Call resource to update
Body
-
FallbackMethod string(http-method)
The HTTP method that we should use to request the
fallback_url
. Can be:GET
orPOST
and the default isPOST
. If anapplication_sid
parameter is present, this parameter is ignored.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
FallbackUrl string(uri)
The URL that we call using the
fallback_method
if an error occurs when requesting or executing the TwiML aturl
. If anapplication_sid
parameter is present, this parameter is ignored. -
Method string(http-method)
The HTTP method we should use when calling the
url
. Can be:GET
orPOST
and the default isPOST
. If anapplication_sid
parameter is present, this parameter is ignored.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
Status string
The new status of the resource. Can be:
canceled
orcompleted
. Specifyingcanceled
will attempt to hang up calls that are queued or ringing; however, it will not affect calls already in progress. Specifyingcompleted
will attempt to hang up a call even if it's already in progress.Values are
canceled
orcompleted
. -
StatusCallback string(uri)
The URL we should call using the
status_callback_method
to send status information to your application. If nostatus_callback_event
is specified, we will send thecompleted
status. If anapplication_sid
parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). -
StatusCallbackMethod string(http-method)
The HTTP method we should use when requesting the
status_callback
URL. Can be:GET
orPOST
and the default isPOST
. If anapplication_sid
parameter is present, this parameter is ignored.Values are
HEAD
,GET
,POST
,PATCH
,PUT
, orDELETE
. -
TimeLimit integer
The maximum duration of the call in seconds. Constraints depend on account and configuration.
-
Twiml string
TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
-
Url string(uri)
The absolute URL that returns the TwiML instructions for the call. We will call this URL using the
method
when the call connects. For more information, see the Url Parameter section in Making Calls.
curl \
-X POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'FallbackMethod=HEAD&FallbackUrl=https%3A%2F%2Fexample.com&Method=HEAD&Status=canceled&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackMethod=HEAD&TimeLimit=42&Twiml=string&Url=https%3A%2F%2Fexample.com'
{
"FallbackMethod": "HEAD",
"FallbackUrl": "https://example.com",
"Method": "HEAD",
"Status": "canceled",
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"TimeLimit": 42,
"Twiml": "string",
"Url": "https://example.com"
}
{
"FallbackMethod": "HEAD",
"FallbackUrl": "https://example.com",
"Method": "HEAD",
"Status": "canceled",
"StatusCallback": "https://example.com",
"StatusCallbackMethod": "HEAD",
"TimeLimit": 42,
"Twiml": "string",
"Url": "https://example.com"
}
{
"account_sid": "string",
"answered_by": "string",
"api_version": "string",
"caller_name": "string",
"date_created": "string",
"date_updated": "string",
"direction": "string",
"duration": "string",
"end_time": "string",
"forwarded_from": "string",
"from": "string",
"from_formatted": "string",
"group_sid": "string",
"parent_call_sid": "string",
"phone_number_sid": "string",
"price": "string",
"price_unit": "string",
"queue_time": "string",
"sid": "string",
"start_time": "string",
"status": "queued",
"subresource_uris": {},
"to": "string",
"to_formatted": "string",
"trunk_sid": "string",
"uri": "https://example.com"
}
{
"account_sid": "string",
"answered_by": "string",
"api_version": "string",
"caller_name": "string",
"date_created": "string",
"date_updated": "string",
"direction": "string",
"duration": "string",
"end_time": "string",
"forwarded_from": "string",
"from": "string",
"from_formatted": "string",
"group_sid": "string",
"parent_call_sid": "string",
"phone_number_sid": "string",
"price": "string",
"price_unit": "string",
"queue_time": "string",
"sid": "string",
"start_time": "string",
"status": "queued",
"subresource_uris": {},
"to": "string",
"to_formatted": "string",
"trunk_sid": "string",
"uri": "https://example.com"
}