Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Call Resource


A Call is an object that represents a connection between a telephone and Twilio.

Using this resource, you can initiate a call, fetch information about a completed call, fetch a list of calls made to and from your account, redirect or end a call that is in progress, and delete records of past calls from your account.

An inbound call occurs when a person calls one of your Twilio phone numbers, client connections, or SIP-enabled endpoints. An outbound call happens when you initiate a call from a Twilio phone number to an outside phone number, client, or SIP domain.

You can initiate an outbound call by sending an HTTP POST request to the Call resource, creating a new call.

You can also initiate a call from an active call (e.g., forwarding to another number or dialing into a conference) by including TwiML's <Dial> verb in your TwiML application. However, the only way to initiate a call directly from Twilio is with an API request.

(information)

Info

Are you looking for step-by-step instructions for making your first call with Twilio using the helper libraries? Check out one of our quickstarts in your programming language of choice: C#/.NET, Java, Node.js, PHP, Python, or Ruby.


Call Properties

call-properties page anchor
Resource properties
sidtype: SID<CA>Not PII

The unique string that we created to identify this Call resource.


date_updatedtype: string<DATE TIME RFC 2822>Not PII

The date and time in GMT that this resource was last updated, specified in RFC 2822(link takes you to an external page) format.


parent_call_sidtype: SID<CA>Not PII

The SID that identifies the call that created this leg.


account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that created this Call resource.


totype: stringPII MTL: 120 days

The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in E.164(link takes you to an external page) format (e.g., +16175551212). SIP addresses are formatted as name@company.com. Client identifiers are formatted client:name. SIM SIDs are formatted as sim:sid.


to_formattedtype: stringPII MTL: 120 days

The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in E.164(link takes you to an external page) format (e.g., +442071838750).


fromtype: stringPII MTL: 120 days

The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in E.164(link takes you to an external page) format (e.g., +16175551212). SIP addresses are formatted as name@company.com. Client identifiers are formatted client:name. SIM SIDs are formatted as sim:sid.


from_formattedtype: stringPII MTL: 120 days

The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in E.164(link takes you to an external page) format (e.g., +442071838750).


phone_number_sidtype: SID<PN>Not PII

If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed.


statustype: enum<STRING>Not PII

The status of this call. Can be: queued, ringing, in-progress, canceled, completed, failed, busy or no-answer. See Call Status Values(link takes you to an external page) below for more information.

Possible values:
queuedringingin-progresscompletedbusyfailedno-answercanceled

start_timetype: string<DATE TIME RFC 2822>Not PII

The start time of the call, given as GMT in RFC 2822(link takes you to an external page) format. Empty if the call has not yet been dialed.


end_timetype: string<DATE TIME RFC 2822>Not PII

The time the call ended, given as GMT in RFC 2822(link takes you to an external page) format. Empty if the call did not complete successfully.


durationtype: stringNot PII

The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls.


pricetype: stringNot PII

The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.


price_unittype: string<CURRENCY>Not PII

The currency in which Price is measured, in ISO 4127(link takes you to an external page) format (e.g., USD, EUR, JPY). Always capitalized for calls.


directiontype: stringNot PII

A string describing the direction of the call. Can be: inbound for inbound calls, outbound-api for calls initiated via the REST API or outbound-dial for calls initiated by a <Dial> verb. Using Elastic SIP Trunking(link takes you to an external page), the values can be trunking-terminating(link takes you to an external page) for outgoing calls from your communications infrastructure to the PSTN or trunking-originating(link takes you to an external page) for incoming calls to your communications infrastructure from the PSTN.


answered_bytype: stringNot PII

Either human or machine if this call was initiated with answering machine detection. Empty otherwise.


api_versiontype: stringNot PII

The API version used to create the call.


forwarded_fromtype: stringPII MTL: 120 days

The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.


group_sidtype: SID<GP>Not PII

The Group SID associated with this call. If no Group is associated with the call, the field is empty.


caller_nametype: stringPII MTL: 120 days

The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.


queue_timetype: stringNot PII

The wait time in milliseconds before the call is placed.


trunk_sidtype: SID<TK>Not PII

The unique identifier of the trunk resource that was used for this call. The field is empty if the call was not made using a SIP trunk or if the call is not terminated.


uritype: stringNot PII

The URI of this resource, relative to https://api.twilio.com.


subresource_uristype: object<URI MAP>Not PII

A list of subresources available to this call, identified by their URIs relative to https://api.twilio.com.


The following are the possible values for the Status parameter:

StatusDescription
queuedThe call is ready and waiting in line before dialing.
ringingThe call is currently ringing.
in-progressThe call was answered and is currently in progress.
canceledThe call was hung up while it was queued or ringing.
completedThe call was answered and has ended normally.
busyThe caller received a busy signal.
no-answerThere was no answer or the call was rejected.
failedThe call could not be completed as dialed, most likely because the phone number was non-existent.

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls.json

Calls can be made via the REST API to phone numbers, SIP addresses, or client identifiers. To place a new outbound call, make an HTTP POST request to your account's Call resource.

Parameters

create-parameters page anchor
URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that will create the resource.


Request body parameters
Totype: string<ENDPOINT>PII MTL: 120 days
Required

The phone number, SIP address, or client identifier to call.


Fromtype: string<ENDPOINT>PII MTL: 120 days
Required

The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified outgoing caller id(link takes you to an external page) for your account. If the to parameter is a phone number, From must also be a phone number.


Methodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when calling the url parameter's value. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

FallbackUrltype: string<URI>Not PII

The URL that we call using the fallback_method if an error occurs when requesting or executing the TwiML at url. If an application_sid parameter is present, this parameter is ignored.


FallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method that we should use to request the fallback_url. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

StatusCallbacktype: string<URI>Not PII

The URL we should call using the status_callback_method to send status information to your application. If no status_callback_event is specified, we will send the completed status. If an application_sid parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).


StatusCallbackEventtype: string[]Not PII

The call progress events that we will send to the status_callback URL. Can be: initiated, ringing, answered, and completed. If no event is specified, we send the completed status. If you want to receive multiple events, specify each one in a separate status_callback_event parameter. See the code sample for monitoring call progress(link takes you to an external page). If an application_sid is present, this parameter is ignored.


StatusCallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when calling the status_callback URL. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

SendDigitstype: stringNot PII

A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (0-9), '#', '*' and 'w', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be ww1234#. Remember to URL-encode this string, since the '#' character has special meaning in a URL. If both SendDigits and MachineDetection parameters are provided, then MachineDetection will be ignored.


Timeouttype: integerNot PII

The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is 60 seconds and the maximum is 600 seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as 15 seconds, to hang up before reaching an answering machine or voicemail.


Recordtype: booleanNot PII

Whether to record the call. Can be true to record the phone call, or false to not. The default is false. The recording_url is sent to the status_callback URL.


RecordingChannelstype: stringNot PII

The number of channels in the final recording. Can be: mono or dual. The default is mono. mono records both legs of the call in a single channel of the recording file. dual records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call.


RecordingStatusCallbacktype: stringNot PII

The URL that we call when the recording is available to be accessed.


RecordingStatusCallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when calling the recording_status_callback URL. Can be: GET or POST and the default is POST.

Possible values:
HEADGETPOSTPATCHPUTDELETE

SipAuthUsernametype: stringNot PII

The username used to authenticate the caller making a SIP call.


SipAuthPasswordtype: stringNot PII

The password required to authenticate the user account specified in sip_auth_username.


MachineDetectiontype: stringNot PII

Whether to detect if a human, answering machine, or fax has picked up the call. Can be: Enable or DetectMessageEnd. Use Enable if you would like us to return AnsweredBy as soon as the called party is identified. Use DetectMessageEnd, if you would like to leave a message on an answering machine. If send_digits is provided, this parameter is ignored. For more information, see Answering Machine Detection(link takes you to an external page).


MachineDetectionTimeouttype: integerNot PII

The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with AnsweredBy of unknown. The default timeout is 30 seconds.


RecordingStatusCallbackEventtype: string[]Not PII

The recording status events that will trigger calls to the URL specified in recording_status_callback. Can be: in-progress, completed and absent. Defaults to completed. Separate multiple values with a space.


Trimtype: stringNot PII

Whether to trim any leading and trailing silence from the recording. Can be: trim-silence or do-not-trim and the default is trim-silence.


CallerIdtype: stringNot PII

The phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format(link takes you to an external page) (e.g., +16175551212). SIP addresses are formatted as name@company.com.


MachineDetectionSpeechThresholdtype: integerNot PII

The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400.


MachineDetectionSpeechEndThresholdtype: integerNot PII

The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200.


MachineDetectionSilenceTimeouttype: integerNot PII

The number of milliseconds of initial silence after which an unknown AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000.


AsyncAmdtype: stringNot PII

Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: true or false.


AsyncAmdStatusCallbacktype: string<URI>Not PII

The URL that we should call using the async_amd_status_callback_method to notify customer application whether the call was answered by human, machine or fax.


AsyncAmdStatusCallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when calling the async_amd_status_callback URL. Can be: GET or POST and the default is POST.

Possible values:
HEADGETPOSTPATCHPUTDELETE

Byoctype: SID<BY>Not PII

The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that byoc is only meaningful when to is a phone number; it will otherwise be ignored. (Beta)


CallReasontype: stringNot PII

The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta)


CallTokentype: stringNot PII

A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call.


RecordingTracktype: stringNot PII

The audio track to record for the call. Can be: inbound, outbound or both. The default is both. inbound records the audio that is received by Twilio. outbound records the audio that is generated from Twilio. both records the audio that is received and generated by Twilio.


TimeLimittype: integerNot PII

The maximum duration of the call in seconds. Constraints depend on account and configuration.


Urltype: string<URI>Not PII
Required if Twiml or ApplicationSid is not passed

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(link takes you to an external page) section in Making Calls(link takes you to an external page).


Twimltype: string<TWIML>Not PII
Required if Url or ApplicationSid is not passed

TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both twiml and url are provided then twiml parameter will be ignored. Max 4000 characters.


ApplicationSidtype: SID<AP>Not PII
Required if Url or Twiml is not passed

The SID of the Application resource that will handle the call, if the call will be handled by an application.

Create a Call resource with TwiML

create-a-call-resource-with-twiml page anchor

Provide TwiML instructions of what should happen when the call is connected.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.create({
_14
twiml: '<Response><Say>Ahoy there!</Say></Response>',
_14
to: '+15558675310',
_14
from: '+15552223214'
_14
})
_14
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+15552223214",
_37
"from_formatted": "(555) 222-3214",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+15558675310",
_37
"to_formatted": "(555) 867-5310",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Create a Call resource with a URL

create-a-call-resource-with-a-url page anchor

Twilio will make a synchronous request to the URL specified to retrieve instructions on how to handle the call.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.create({
_14
url: 'http://demo.twilio.com/docs/voice.xml',
_14
to: '+15558675310',
_14
from: '+15017122661'
_14
})
_14
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+15017122661",
_37
"from_formatted": "(501) 712-2661",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+15558675310",
_37
"to_formatted": "(555) 867-5310",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Create a Call resource and specify a StatusCallback URL

create-a-call-resource-and-specify-a-statuscallback-url page anchor

This example sets a StatusCallback so that Twilio can return information about the call to the specified URL.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = require('twilio')(accountSid, authToken);
_17
_17
client.calls
_17
.create({
_17
method: 'GET',
_17
statusCallback: 'https://www.myapp.com/events',
_17
statusCallbackMethod: 'POST',
_17
url: 'http://demo.twilio.com/docs/voice.xml',
_17
to: '+14155551212',
_17
from: '+18668675310'
_17
})
_17
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+18668675310",
_37
"from_formatted": "(866) 867-5310",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14155551212",
_37
"to_formatted": "(415) 555-1212",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Create a Call resource and specify a StatusCallbackEvent

create-a-call-resource-and-specify-a-statuscallbackevent page anchor

This example places a call and requests a callback when the call is initiated.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = require('twilio')(accountSid, authToken);
_18
_18
client.calls
_18
.create({
_18
method: 'GET',
_18
statusCallback: 'https://www.myapp.com/events',
_18
statusCallbackEvent: ['initiated', 'answered'],
_18
statusCallbackMethod: 'POST',
_18
url: 'http://demo.twilio.com/docs/voice.xml',
_18
to: '+14155551212',
_18
from: '+18668675310'
_18
})
_18
.then(call => console.log(call.sid));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+18668675310",
_37
"from_formatted": "(866) 867-5310",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14155551212",
_37
"to_formatted": "(415) 555-1212",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

StatusCallback

statuscallback page anchor

After completing an outbound call, Twilio will make an asynchronous HTTP request to the StatusCallback URL you specified in your request (if any).

Parameters sent to your StatusCallback URL

parameters-sent-to-your-statuscallback-url page anchor

When Twilio sends its asynchronous request to your StatusCallback URL, it includes all of the following parameters:

ParameterDescription
CallSidA unique identifier for this call, generated by Twilio.
AccountSidYour Twilio account ID. It is 34 characters long, and always starts with the letters AC.
FromThe phone number or client identifier of the party that initiated the call.

Phone numbers use E.164 formatting, meaning they start with a + and country code, e.g. +16175551212.

Client identifiers begin with the client: URI scheme; for example, on a call from a client named 'charlie' the From parameter will be client:charlie.
ToThe phone number or client identifier of the called party.

Phone numbers use E.164 formatting, meaning they start with a + and country code, e.g. +16175551212.

Client identifiers begin with the client: URI scheme; for example, for a call to a client named 'joey', the To parameter will be client:joey.
CallStatusA descriptive status for the call.

The value is one of the following: queued, initiated, ringing, in-progress, completed, busy, failed or no-answer.
ApiVersionThe version of the Twilio API used to handle this call.

For incoming calls, this is determined by the API version set on the dialed number.

For outgoing calls, this is the version used in the REST API request of the outgoing call.
DirectionA string describing the direction of the call:
  • inbound for inbound calls
  • outbound-api for calls initiated via the REST API
  • outbound-dial for calls initiated by a <Dial> verb.
ForwardedFromThis parameter may be set when Twilio receives a forwarded call. The carrier who forwards the call determines the contents of the parameter.

Not all carriers support passing this information.

Some carriers provide this information when making a direct call to a Twilio number.
CallerNameThis parameter is set when the IncomingPhoneNumber that received the call has set its VoiceCallerIdLookup value to true ($0.01 per lookup).
ParentCallSidA unique identifier for the call that created this leg.

If this is the first leg of a call, this parameter is not included.

If you specify any call progress events in the StatusCallbackEvent parameter, Twilio will make an asynchronous request to the StatusCallback URL you provided in your POST request.

The call progress events you can specify are:

EventDescription
initiatedTwilio removes your call from the queue and starts dialing.
ringingThe call starts ringing.
answeredThe call is answered. If this event is specified, Twilio will send an in-progress status.
completedThe call is completed, regardless of the termination status (which can be busy, cancelled, completed, failed, or no-answer). If no StatusCallbackEvent is specified, completed is fired by default.

When these events occur, Twilio's StatusCallback request will also include these additional parameters:

ParameterDescription
CallStatusA descriptive status for the call. The value is one of queued, initiated, ringing, in-progress, busy, failed, or no-answer. For more details, see the CallStatus values in our TwiML introduction.
DurationThe duration in minutes of the just-completed call; calls are billed by the minute. Only present in the completed event.
CallDurationThe duration in seconds of the just-completed call. Only present in the completed event.
SipResponseCodeThe SIP code that resulted in a failed call. For instance, a number that was unreachable will return 404, and if the Timeout value was reached before the call connected this code will be 487.

Only present in the completed event if the CallStatus is failed or no-answer.
RecordingUrlThe URL of the phone call's recorded audio. This parameter is included only if Record=true is set on the REST API request and does not include recordings initiated in other ways. RecordingUrl is only present in the completed event. The recording file may not yet be accessible when the Status Callback is sent.

Note: Use RecordingStatusCallback for reliable notification on when the recording is available for access.
RecordingSidThe unique ID of the Recording from this call. RecordingSid is only present with the completed event.
RecordingDurationThe duration of the recorded audio (in seconds). RecordingDuration is only present in the completed event. To get a final accurate recording duration after any trimming of silence, use RecordingStatusCallback.
TimestampThe timestamp when the event fired, given as UTC in RFC 2822(link takes you to an external page) format.
CallbackSourceA string that describes the source of the webhook. This is provided to help disambiguate why the webhook was made. On Status Callbacks, this value is always call-progress-events.
SequenceNumberThe order in which the events were fired, starting from 0. Although events are fired in order, they are made as separate HTTP requests, and there is no guarantee they will arrive in the same order.
(information)

Info

You can use the StatusCallback and StatusCallbackEvent features to track the call status of Programmable Voice calls only.

(information)

Info

To learn more about the StatusCallbackEvent parameter and what you can expect from Twilio during and after an outbound call, check out our overview page on making outbound calls.

If you requested a recording of your outbound call and you specified a RecordingStatusCallback URL, Twilio will make a GET or POST request to that URL when the recording is available.

Parameters sent to your RecordingStatusCallback URL

parameters-sent-to-your-recordingstatuscallback-url page anchor

Twilio will pass along the following parameters to your RecordingStatusCallback URL:

ParameterDescription
AccountSidThe unique identifier of the Account responsible for this recording.
CallSidA unique identifier for the call associated with the recording. CallSid will always refer to the parent leg of a two-leg call.
RecordingSidThe unique identifier for the recording.
RecordingUrlThe URL of the recorded audio.
RecordingStatusThe status of the recording. Possible values are: in-progress, completed, absent.
RecordingDurationThe length of the recording, in seconds.
RecordingChannelsThe number of channels in the final recording file as an integer. Possible values are 1, 2.
RecordingStartTimeThe timestamp of when the recording started.
RecordingSourceThe initiation method used to create this recording. For recordings initiated when Record=true is set on the REST API, OutboundAPI will be returned.
RecordingTrackThe audio track recorded. Possible values are inbound, outbound, or both.

RecordingStatusCallbackEvent

recordingstatuscallbackevent page anchor

Just as you can specify call progress events with StatusCallbackEvent, you can also specify which recording status changes should trigger a callback to your application.

Available recording status values are:

ParameterDescription
in-progressThe recording has started.
completedThe recording is complete and available for access.
absentThe recording is absent and inaccessible.

This parameter defaults to completed. To specify multiple values, separate them with a space.

(information)

Info

To pause, resume, or stop recordings, see the Call Recording resource.


GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json

This API call returns the Call resource of an individual call, identified by its CallSid. This resource is eventually consistent(link takes you to an external page).

(warning)

Warning

To get real-time call status updates, we recommend using the StatusCallbackEvent on the Outbound API request or the TwiML <Dial> verb statusCallbackEvent attribute for the case of child calls.

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Call resource(s) to fetch.


Sidtype: SID<CA>Not PII
Path Parameter

The SID of the Call resource to fetch.

Get a specific Call, as specified by it's unique identifier (CallSid).

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(call => console.log(call.to));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": "machine_start",
_37
"api_version": "2010-04-01",
_37
"caller_name": "callerid",
_37
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_37
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_37
"direction": "outbound-api",
_37
"duration": "4",
_37
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_37
"forwarded_from": "calledvia",
_37
"from": "+13051416799",
_37
"from_formatted": "(305) 141-6799",
_37
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.200",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+13051913581",
_37
"to_formatted": "(305) 191-3581",
_37
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

You can access the Recordings list subresource on any given Call.

The following will return a list of all of the recordings generated with a given call (identified by its CallSid):


_10
/2010-04-01/Accounts/{YourAccountSid}/Calls/{CallSid}/Recordings

See the Call Recording resource docs for resource properties and response formats.

You can access call quality feedback information from a given phone call by requesting the Feedback subresource on any Call (identified by its CallSid):


_10
/2010-04-01/Accounts/{YourAccountSid}/Calls/{CallSid}/Feedback

See the Call Quality Feedback resource documentation for properties and response formats. See also the FeedbackSummary resource for summarized information about call quality.


Read multiple Call resources

read-multiple-call-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls.json

Return a list of phone calls made to and from an account, identified by its AccountSid.

The following query string parameters allow you to filter and limit the list returned to you by the REST API. These parameters are case-sensitive.

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Call resource(s) to read.


Totype: string<PHONE NUMBER>PII MTL: 120 days
Query Parameter

Only show calls made to this phone number, SIP address, Client identifier or SIM SID.


Fromtype: string<PHONE NUMBER>PII MTL: 120 days
Query Parameter

Only include calls from this phone number, SIP address, Client identifier or SIM SID.


ParentCallSidtype: SID<CA>Not PII
Query Parameter

Only include calls spawned by calls with this SID.


Statustype: enum<STRING>Not PII
Query Parameter

The status of the calls to include. Can be: queued, ringing, in-progress, canceled, completed, failed, busy, or no-answer.

Possible values:
queuedringingin-progresscompletedbusyfailedno-answercanceled

StartTimetype: string<DATE TIME>Not PII
Query Parameter

Only include calls that started on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that started on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read calls that started on or before midnight of this date, and StartTime>=YYYY-MM-DD to read calls that started on or after midnight of this date.


StartTime<type: string<DATE TIME>Not PII
Query Parameter

Only include calls that started on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that started on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read calls that started on or before midnight of this date, and StartTime>=YYYY-MM-DD to read calls that started on or after midnight of this date.


StartTime>type: string<DATE TIME>Not PII
Query Parameter

Only include calls that started on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that started on this date. You can also specify an inequality, such as StartTime<=YYYY-MM-DD, to read calls that started on or before midnight of this date, and StartTime>=YYYY-MM-DD to read calls that started on or after midnight of this date.


EndTimetype: string<DATE TIME>Not PII
Query Parameter

Only include calls that ended on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that ended on this date. You can also specify an inequality, such as EndTime<=YYYY-MM-DD, to read calls that ended on or before midnight of this date, and EndTime>=YYYY-MM-DD to read calls that ended on or after midnight of this date.


EndTime<type: string<DATE TIME>Not PII
Query Parameter

Only include calls that ended on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that ended on this date. You can also specify an inequality, such as EndTime<=YYYY-MM-DD, to read calls that ended on or before midnight of this date, and EndTime>=YYYY-MM-DD to read calls that ended on or after midnight of this date.


EndTime>type: string<DATE TIME>Not PII
Query Parameter

Only include calls that ended on this date. Specify a date as YYYY-MM-DD in GMT, for example: 2009-07-06, to read only calls that ended on this date. You can also specify an inequality, such as EndTime<=YYYY-MM-DD, to read calls that ended on or before midnight of this date, and EndTime>=YYYY-MM-DD to read calls that ended on or after midnight of this date.


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Read multiple Call resources

read-multiple-call-resources-1 page anchor

Get a list of all calls that were placed or received by your Twilio account.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls.list({limit: 20})
_10
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

Read multiple Call resources and filter by start date

read-multiple-call-resources-and-filter-by-start-date page anchor

Filters the call list to return completed calls started on July 6, 2009.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.list({
_14
startTime: new Date(Date.UTC(2009, 6, 6, 0, 0, 0)),
_14
status: 'completed',
_14
limit: 20
_14
})
_14
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

Read multiple Call resources and filter by ‘after start' date

read-multiple-call-resources-and-filter-by-after-start-date page anchor

Filters the call list to return completed calls started on or after midnight July 6, 2009.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.calls
_14
.list({
_14
startTimeAfter: new Date(Date.UTC(2009, 6, 6, 0, 0, 0)),
_14
status: 'completed',
_14
limit: 20
_14
})
_14
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

Read multiple Call resources and filter by a period of time

read-multiple-call-resources--and-filter-by-a-period-of-time page anchor

Filters the call list to return completed calls that started between midnight July 4, 2009 and midnight July 6, 2009.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
client.calls
_15
.list({
_15
startTimeBefore: new Date(Date.UTC(2009, 6, 6, 0, 0, 0)),
_15
startTimeAfter: new Date(Date.UTC(2009, 6, 4, 0, 0, 0)),
_15
status: 'in-progress',
_15
limit: 20
_15
})
_15
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

Read multiple Call resources and filter by call status and phone number

read-multiple-call-resources-and-filter-by-call-status-and-phone-number page anchor

Filters the call list to return calls with the status of ‘busy' that were made with the specified ‘To' number.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls.list({status: 'busy', to: '+15558675310', limit: 20})
_10
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

Read multiple Call resources and filter by calls made from a specific device

read-multiple-call-resources-and-filter-by-calls-made-from-a-specific-device page anchor

Filters the call list to return calls that were made from a Twilio Client device named ‘charlie'.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls.list({from: 'client:charlie', limit: 20})
_10
.then(calls => calls.forEach(c => console.log(c.sid)));

Output

_88
{
_88
"calls": [
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag1",
_88
"answered_by": "machine_start",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid1",
_88
"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",
_88
"direction": "outbound-api",
_88
"duration": "4",
_88
"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",
_88
"forwarded_from": "calledvia1",
_88
"from": "+13051416799",
_88
"from_formatted": "(305) 141-6799",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.200",
_88
"price_unit": "USD",
_88
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913581",
_88
"to_formatted": "(305) 191-3581",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_88
"queue_time": "1000"
_88
},
_88
{
_88
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"annotation": "billingreferencetag2",
_88
"answered_by": "human",
_88
"api_version": "2010-04-01",
_88
"caller_name": "callerid2",
_88
"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",
_88
"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",
_88
"direction": "inbound",
_88
"duration": "3",
_88
"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",
_88
"forwarded_from": "calledvia2",
_88
"from": "+13051416798",
_88
"from_formatted": "(305) 141-6798",
_88
"group_sid": "GPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"parent_call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"price": "-0.100",
_88
"price_unit": "JPY",
_88
"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",
_88
"status": "completed",
_88
"subresource_uris": {
_88
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",
_88
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",
_88
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",
_88
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",
_88
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",
_88
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",
_88
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",
_88
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"
_88
},
_88
"to": "+13051913580",
_88
"to_formatted": "(305) 191-3580",
_88
"trunk_sid": "TKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",
_88
"queue_time": "1000"
_88
}
_88
],
_88
"end": 1,
_88
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",
_88
"page": 0,
_88
"page_size": 2,
_88
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0",
_88
"start": 0,
_88
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&EndTime=2009-01-02&PageSize=2&Page=0"
_88
}

(information)

Info

You can append a .csv extension to any resource URI to get CSV (Comma Separated Values) representation. Specifying CSV may be especially useful for call logs. Try this:


_10
GET /2010-04-01/Accounts/{AccountSid}/Calls.csv

Read the guide to Returning JSON, CSV, and HTML for more information about all available alternate representations.

If you are using the Twilio REST API, the list returned to you includes paging information.

If you plan to request more records than will fit on a single page, you can use the provided nextpageuri rather than incrementing through pages by page number.

Using nextpageuri for paging ensures that your next request will pick up where you left off. This can help keep you from retrieving duplicate data if you are actively making or receiving calls.

(information)

Info

All of the Twilio Helper Libraries handle paging automatically. You do not need to explicitly request individual pages when using a Helper Library to fetch lists of resources.


POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json

Updating a Call resource allows you to modify an active call.

Real-time call modification allows you to interrupt an in-progress call and terminate it or have it begin processing TwiML from either a new URL or from the TwiML provided with modification. Call modification is useful for any application where you want to change the behavior of a running call asynchronously, e.g., hold music, call queues, transferring calls, or forcing a hangup.

By sending an HTTP POST request to a specific Call instance, you can redirect a call that is in progress or you can terminate a call.

(information)

Info

For step-by-step guidance on modifying in-progress calls, check out the tutorial Modify Calls in Progress in your web language of choice.

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Call resource(s) to update.


Sidtype: SID<CA>Not PII
Path Parameter

The Twilio-provided string that uniquely identifies the Call resource to update


Request body parameters
Urltype: string<URI>Not PII

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(link takes you to an external page) section in Making Calls(link takes you to an external page).


Methodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when calling the url. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

Statustype: enum<STRING>Not PII

The new status of the resource. Can be: canceled or completed. Specifying canceled will attempt to hang up calls that are queued or ringing; however, it will not affect calls already in progress. Specifying completed will attempt to hang up a call even if it's already in progress.

Possible values:
canceledcompleted

FallbackUrltype: string<URI>Not PII

The URL that we call using the fallback_method if an error occurs when requesting or executing the TwiML at url. If an application_sid parameter is present, this parameter is ignored.


FallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method that we should use to request the fallback_url. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

StatusCallbacktype: string<URI>Not PII

The URL we should call using the status_callback_method to send status information to your application. If no status_callback_event is specified, we will send the completed status. If an application_sid parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted).


StatusCallbackMethodtype: enum<HTTP METHOD>Not PII

The HTTP method we should use when requesting the status_callback URL. Can be: GET or POST and the default is POST. If an application_sid parameter is present, this parameter is ignored.

Possible values:
HEADGETPOSTPATCHPUTDELETE

Twimltype: string<TWIML>Not PII

TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive


TimeLimittype: integerNot PII

The maximum duration of the call in seconds. Constraints depend on account and configuration.

Update a Call in progress with TwiML

update-a-call-in-progress-with-twiml page anchor

Provide new TwiML instructions to an ongoing call.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({twiml: '<Response><Say>Ahoy there</Say></Response>'})
_10
.then(call => console.log(call.to));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+14158675308",
_37
"from_formatted": "(415) 867-5308",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14158675309",
_37
"to_formatted": "(415) 867-5309",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Update a Call in progress with URL

update-a--call-in-progress-with-url page anchor

Redirect a call in progress by sending an HTTP POST request to the Call, setting the new destination in the code hosted at the URL parameter.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({method: 'POST', url: 'http://demo.twilio.com/docs/voice.xml'})
_10
.then(call => console.log(call.to));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+14158675308",
_37
"from_formatted": "(415) 867-5308",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14158675309",
_37
"to_formatted": "(415) 867-5309",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

Update a Call resource to end the call

update-a-call-resource-to-end-the-call page anchor

End a call in progress by sending an HTTP POST request to the Call, specifying the status to ‘completed'.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({status: 'completed'})
_10
.then(call => console.log(call.to));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+14158675308",
_37
"from_formatted": "(415) 867-5308",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14158675309",
_37
"to_formatted": "(415) 867-5309",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

When you redirect an active call to another phone number, Twilio creates an entirely new Call instance for that new phone number. The original call is the parent call, and any additional number dialed establishes a child call. Parent and child calls will have uniquely identifying Call SIDs.

Note that any parent call currently executing a <Dial> is considered in-progress by Twilio. Even if you've re-directed your initial call to a new number, the parent call is still active, and thus you must useStatus=completed to end it.

(warning)

Warning

If Enhanced SIP Features(link takes you to an external page) is not enabled on your account, unanswered child calls cannot be canceled via the REST API, but the parent call can be modified to point to new TwiML. This action will end the child call.

Update the StatusCallback of an active Call

update-the-statuscallback-of-an-active-call page anchor

Ensure that you also specify the URL when updating the StatusCallback

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13
.update({
_13
url: 'https://example.com/twiml',
_13
statusCallback: 'https://example.com/status-changed'
_13
})
_13
.then(call => console.log(call.to));

Output

_37
{
_37
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"answered_by": null,
_37
"api_version": "2010-04-01",
_37
"caller_name": null,
_37
"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",
_37
"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"direction": "inbound",
_37
"duration": "15",
_37
"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",
_37
"forwarded_from": "+141586753093",
_37
"from": "+14158675308",
_37
"from_formatted": "(415) 867-5308",
_37
"group_sid": null,
_37
"parent_call_sid": null,
_37
"phone_number_sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"price": "-0.03000",
_37
"price_unit": "USD",
_37
"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_37
"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",
_37
"status": "completed",
_37
"subresource_uris": {
_37
"notifications": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Notifications.json",
_37
"recordings": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings.json",
_37
"payments": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Payments.json",
_37
"events": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Events.json",
_37
"siprec": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Siprec.json",
_37
"streams": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Streams.json",
_37
"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessageSubscriptions.json",
_37
"user_defined_messages": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/UserDefinedMessages.json"
_37
},
_37
"to": "+14158675309",
_37
"to_formatted": "(415) 867-5309",
_37
"trunk_sid": null,
_37
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls/CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json",
_37
"queue_time": "1000"
_37
}

(warning)

Warning

To update a StatusCallback on a Call, it is required to set the Url in the same statement.


DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{Sid}.json

This will delete a call record from your account. Once the record is deleted, it will no longer appear in the API and Account Portal logs.

If successful, this DELETE returns an HTTP 204 (No Content) with no body.

DELETE on a call record will also delete any associated call events, but will not delete associated recordings and transcription records.

(warning)

Warning

Note that an error will occur if you attempt to remove a call record for a call that is actively in progress.

URI parameters
AccountSidtype: SID<AC>Not PII
Path Parameter

The SID of the Account(link takes you to an external page) that created the Call resource(s) to delete.


Sidtype: SID<CA>Not PII
Path Parameter

The Twilio-provided Call SID that uniquely identifies the Call resource to delete

(error)

Danger

Note: For calls less than 13 months old, resources deleted from this endpoint will also be deleted in Log Archives. Calls older than 13 months can only be deleted via the Bulk Export API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();


You are able to retrieve resources via GET to the /Calls endpoint for 13 months after the resource is created. Records older than thirteen months can only be retrieved via Bulk Export.

We provide a Bulk Export utility in Console(link takes you to an external page) and via API. Bulk Export will generate S3 files containing one day of data per file and deliver the download link via webhook, email, or Console.


Explore Voice Insights with its Call Insights Event Stream and Call Insights REST API which allow you to see call parameters, investigate call metrics and event timelines, and understand detected quality issues.


Rate this page: