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. Calls are rate limited at the account level by Calls Per Second (CPS). Calls beyond your account's CPS limit will be queued and will execute at the CPS rate.
The queue_time
parameter provides an estimate for how long before the call is executed. You can reduce queue_time
by increasing the CPS value on your account.
By default, each account is granted one CPS for calls created via POST
requests to the /Calls
endpoint. Inbound calls and <Dial>
calls are not limited by CPS.
Accounts with an approved Business Profile can update their CPS up to 30 in the Twilio Console.
In aggregate, calls are executed at the rate defined by the CPS. Individual calls may not execute at the anticipated rate — you may see individual seconds with more or fewer CPS, especially for inconsistent traffic — but over a month, the call execution rate will average the CPS rate set for that account or trunk.
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.
The unique string that we created to identify this Call resource.
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in UTC that this resource was created specified in RFC 2822 format.
The date and time in UTC that this resource was last updated, specified in RFC 2822 format.
The SID that identifies the call that created this leg.
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created this Call resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in E.164 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
.
The phone number, SIP address or Client identifier that received this call. Formatted for display. Non-North American phone numbers are in E.164 format (e.g., +442071838750).
The phone number, SIP address, Client identifier or SIM SID that made this call. Phone numbers are in E.164 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
.
The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in E.164 format (e.g., +442071838750).
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.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The status of this call. Can be: queued
, ringing
, in-progress
, canceled
, completed
, failed
, busy
or no-answer
. See Call Status Values below for more information.
queued
ringing
in-progress
completed
busy
failed
no-answer
canceled
The start time of the call, given as UTC in RFC 2822 format. Empty if the call has not yet been dialed.
The time the call ended, given as UTC in RFC 2822 format. Empty if the call did not complete successfully.
The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls.
The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value.
The currency in which Price
is measured, in ISO 4127 format (e.g., USD
, EUR
, JPY
). Always capitalized for calls.
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, the values can be trunking-terminating
for outgoing calls from your communications infrastructure to the PSTN or trunking-originating
for incoming calls to your communications infrastructure from the PSTN.
Either human
or machine
if this call was initiated with answering machine detection. Empty otherwise.
The forwarding phone number if this call was an incoming call forwarded from another number (depends on carrier supporting forwarding). Otherwise, empty.
The Group SID associated with this call. If no Group is associated with the call, the field is empty.
^GP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The caller's name if this call was an incoming call to a phone number with caller ID Lookup enabled. Otherwise, empty.
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.
^TK[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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:
Status | Description |
---|---|
queued | The call is ready and waiting in line before dialing. |
ringing | The call is currently ringing. |
in-progress | The call was answered and is currently in progress. |
canceled | The call was hung up while it was queued or ringing. |
completed | The call was answered and has ended normally. |
busy | The caller received a busy signal. |
no-answer | There was no answer or the call was rejected. |
failed | The call could not be completed as dialed, most likely because the provided number was invalid. |
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.
application/x-www-form-urlencoded
The phone number, SIP address, or client identifier to call.
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 for your account. If the to
parameter is a phone number, From
must also be a phone number.
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.
GET
POST
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.
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.
GET
POST
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).
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. If an application_sid
is present, this parameter is ignored.
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.
GET
POST
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.
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.
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.
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.
The URL that we call when the recording is available to be accessed.
The HTTP method we should use when calling the recording_status_callback
URL. Can be: GET
or POST
and the default is POST
.
GET
POST
The password required to authenticate the user account specified in sip_auth_username
.
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.
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.
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.
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
.
The phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as name@company.com
.
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.
The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200.
The number of milliseconds of initial silence after which an unknown
AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000.
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
.
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.
The HTTP method we should use when calling the async_amd_status_callback
URL. Can be: GET
or POST
and the default is POST
.
GET
POST
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)
^BY[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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)
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.
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.
The maximum duration of the call in seconds. Constraints depend on account and configuration.
The absolute URL that returns the TwiML instructions for the call. We will call this URL using the method
when the call connects. For more information, see the Url Parameter section in Making Calls.
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.
The SID of the Application resource that will handle the call, if the call will be handled by an application.
^AP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCall() {11const call = await client.calls.create({12from: "+15552223214",13to: "+15558675310",14twiml: "<Response><Say>Ahoy there!</Say></Response>",15});1617console.log(call.sid);18}1920createCall();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+15552223214",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+15558675310",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCall() {11const call = await client.calls.create({12from: "+15017122661",13to: "+15558675310",14url: "http://demo.twilio.com/docs/voice.xml",15});1617console.log(call.sid);18}1920createCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+15017122661",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+15558675310",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCall() {11const call = await client.calls.create({12from: "+18668675310",13method: "GET",14statusCallback: "https://www.myapp.com/events",15statusCallbackMethod: "POST",16to: "+14155551212",17url: "http://demo.twilio.com/docs/voice.xml",18});1920console.log(call.sid);21}2223createCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+18668675310",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14155551212",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCall() {11const call = await client.calls.create({12from: "+18668675310",13method: "GET",14statusCallback: "https://www.myapp.com/events",15statusCallbackEvent: ["initiated", "answered"],16statusCallbackMethod: "POST",17to: "+14155551212",18url: "http://demo.twilio.com/docs/voice.xml",19});2021console.log(call.sid);22}2324createCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+18668675310",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14155551212",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
After completing an outbound call, Twilio will make an asynchronous HTTP request to the StatusCallback
URL you specified in your request (if any).
When Twilio sends its asynchronous request to your StatusCallback
URL, it includes all of the following parameters:
Parameter | Description |
---|---|
CallSid | A unique identifier for this call, generated by Twilio. |
AccountSid | Your Twilio account ID. It is 34 characters long, and always starts with the letters AC . |
From | The 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 . |
To | The 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 . |
CallStatus | A descriptive status for the call. The value is one of the following: queued , initiated , ringing , in-progress , completed , busy , failed or no-answer . |
ApiVersion | The 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. |
Direction | A string describing the direction of the call:
|
ForwardedFrom | This 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. |
CallerName | This parameter is set when the IncomingPhoneNumber that received the call has set its VoiceCallerIdLookup value to true ($0.01 per lookup). |
ParentCallSid | A 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:
Event | Description |
---|---|
initiated | Twilio removes your call from the queue and starts dialing. |
ringing | The call starts ringing. |
answered | The call is answered. If this event is specified, Twilio will send an in-progress status. |
completed | The 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:
Parameter | Description |
---|---|
CallStatus | A 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. |
Duration | The duration in minutes of the just-completed call; calls are billed by the minute. Only present in the completed event. |
CallDuration | The duration in seconds of the just-completed call. Only present in the completed event. |
SipResponseCode | The final SIP code for the call. For example, a number that was unreachable will return 404. If the Timeout value was reached before the call connected, this code will be 487. |
RecordingUrl | The 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. |
RecordingSid | The unique ID of the Recording from this call. RecordingSid is only present with the completed event. |
RecordingDuration | The 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 . |
Timestamp | The timestamp when the event fired, given as UTC in RFC 2822 format. |
CallbackSource | A 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 . |
SequenceNumber | The 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. |
You can use the StatusCallback
and StatusCallbackEvent
features to track the call status of Programmable Voice calls only.
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.
Twilio will pass along the following parameters to your RecordingStatusCallback
URL:
Parameter | Description |
---|---|
AccountSid | The unique identifier of the Account responsible for this recording. |
CallSid | A unique identifier for the call associated with the recording. CallSid will always refer to the parent leg of a two-leg call. |
RecordingSid | The unique identifier for the recording. |
RecordingUrl | The URL of the recorded audio. |
RecordingStatus | The status of the recording. Possible values are: in-progress , completed , absent . |
RecordingDuration | The length of the recording, in seconds. |
RecordingChannels | The number of channels in the final recording file as an integer. Possible values are 1 , 2 . |
RecordingStartTime | The timestamp of when the recording started. |
RecordingSource | The initiation method used to create this recording. For recordings initiated when Record=true is set on the REST API, OutboundAPI will be returned. |
RecordingTrack | The audio track recorded. Possible values are inbound , outbound , or both . |
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:
Parameter | Description |
---|---|
in-progress | The recording has started. |
completed | The recording is complete and available for access. |
absent | The recording is absent and inaccessible. |
This parameter defaults to completed
. To specify multiple values, separate them with a space.
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.
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.
The SID of the Account that created the Call resource(s) to fetch.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Call resource to fetch.
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchCall() {11const call = await client.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch();1213console.log(call.sid);14}1516fetchCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": "billingreferencetag",4"answered_by": "machine_start",5"api_version": "2010-04-01",6"caller_name": "callerid",7"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",8"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",9"direction": "outbound-api",10"duration": "4",11"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",12"forwarded_from": "calledvia",13"from": "+13051416799",14"from_formatted": "(305) 141-6799",15"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",16"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",17"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",18"price": "-0.200",19"price_unit": "USD",20"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",21"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+13051913581",35"to_formatted": "(305) 191-3581",36"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
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
):
/2010-04-01/Accounts/{YourAccountSid}/Calls/{CallSid}/Recordings
See the Call Recording resource docs for resource properties and response formats.
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.
Only show calls made to this phone number, SIP address, Client identifier or SIM SID.
Only include calls from this phone number, SIP address, Client identifier or SIM SID.
Only include calls spawned by calls with this SID.
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The status of the calls to include. Can be: queued
, ringing
, in-progress
, canceled
, completed
, failed
, busy
, or no-answer
.
queued
ringing
in-progress
completed
busy
failed
no-answer
canceled
Only include calls that started on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
Only include calls that started on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
Only include calls that started on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
Only include calls that ended on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
Only include calls that ended on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
Only include calls that ended on this date. Specify a date as YYYY-MM-DD
in UTC, 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.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({ limit: 20 });1213calls.forEach((c) => console.log(c.sid));14}1516listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({12startTime: new Date("2009-07-06 00:00:00"),13status: "completed",14limit: 20,15});1617calls.forEach((c) => console.log(c.sid));18}1920listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({12startTimeAfter: new Date("2009-07-06 00:00:00"),13status: "completed",14limit: 20,15});1617calls.forEach((c) => console.log(c.sid));18}1920listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({12startTimeBefore: new Date("2009-07-06 00:00:00"),13startTimeAfter: new Date("2009-07-04 00:00:00"),14status: "in-progress",15limit: 20,16});1718calls.forEach((c) => console.log(c.sid));19}2021listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({12status: "busy",13to: "+15558675310",14limit: 20,15});1617calls.forEach((c) => console.log(c.sid));18}1920listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listCall() {11const calls = await client.calls.list({12from: "client:charlie",13limit: 20,14});1516calls.forEach((c) => console.log(c.sid));17}1819listCall();
1{2"calls": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"annotation": "billingreferencetag1",6"answered_by": "machine_start",7"api_version": "2010-04-01",8"caller_name": "callerid1",9"date_created": "Fri, 18 Oct 2019 17:00:00 +0000",10"date_updated": "Fri, 18 Oct 2019 17:01:00 +0000",11"direction": "outbound-api",12"duration": "4",13"end_time": "Fri, 18 Oct 2019 17:03:00 +0000",14"forwarded_from": "calledvia1",15"from": "+13051416799",16"from_formatted": "(305) 141-6799",17"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeef",18"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeef",19"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeef",20"price": "-0.200",21"price_unit": "USD",22"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",23"start_time": "Fri, 18 Oct 2019 17:02:00 +0000",24"status": "completed",25"subresource_uris": {26"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",27"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",28"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",29"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",30"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",31"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",32"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",33"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",34"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"35},36"to": "+13051913581",37"to_formatted": "(305) 191-3581",38"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",39"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",40"queue_time": "1000"41},42{43"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",44"annotation": "billingreferencetag2",45"answered_by": "human",46"api_version": "2010-04-01",47"caller_name": "callerid2",48"date_created": "Fri, 18 Oct 2019 16:00:00 +0000",49"date_updated": "Fri, 18 Oct 2019 16:01:00 +0000",50"direction": "inbound",51"duration": "3",52"end_time": "Fri, 18 Oct 2019 16:03:00 +0000",53"forwarded_from": "calledvia2",54"from": "+13051416798",55"from_formatted": "(305) 141-6798",56"group_sid": "GPdeadbeefdeadbeefdeadbeefdeadbeee",57"parent_call_sid": "CAdeadbeefdeadbeefdeadbeefdeadbeee",58"phone_number_sid": "PNdeadbeefdeadbeefdeadbeefdeadbeee",59"price": "-0.100",60"price_unit": "JPY",61"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",62"start_time": "Fri, 18 Oct 2019 16:02:00 +0000",63"status": "completed",64"subresource_uris": {65"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Notifications.json",66"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Recordings.json",67"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Payments.json",68"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Events.json",69"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Siprec.json",70"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Streams.json",71"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/Transcriptions.json",72"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessageSubscriptions.json",73"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0/UserDefinedMessages.json"74},75"to": "+13051913580",76"to_formatted": "(305) 191-3580",77"trunk_sid": "TKdeadbeefdeadbeefdeadbeefdeadbeef",78"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0.json",79"queue_time": "1000"80}81],82"end": 1,83"first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0",84"next_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0",85"page": 0,86"page_size": 2,87"previous_page_uri": null,88"start": 0,89"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0"90}
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:
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.
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.
For step-by-step guidance on modifying in-progress calls, check out the tutorial Modify Calls in Progress in your web language of choice.
The SID of the Account that created the Call resource(s) to update.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Call resource to update
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
The absolute URL that returns the TwiML instructions for the call. We will call this URL using the method
when the call connects. For more information, see the Url Parameter section in Making Calls.
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.
GET
POST
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.
canceled
completed
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.
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.
GET
POST
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).
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.
GET
POST
TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive
The maximum duration of the call in seconds. Constraints depend on account and configuration.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateCall() {11const call = await client12.calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.update({ twiml: "<Response><Say>Ahoy there</Say></Response>" });1415console.log(call.sid);16}1718updateCall();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+14158675308",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14158675309",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateCall() {11const call = await client.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update({12method: "POST",13url: "http://demo.twilio.com/docs/voice.xml",14});1516console.log(call.sid);17}1819updateCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+14158675308",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14158675309",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateCall() {11const call = await client12.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.update({ status: "completed" });1415console.log(call.sid);16}1718updateCall();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+14158675308",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14158675309",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
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.
If Enhanced SIP Features 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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateCall() {11const call = await client.calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").update({12statusCallback: "https://example.com/status-changed",13url: "https://example.com/twiml",14});1516console.log(call.sid);17}1819updateCall();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"annotation": null,4"answered_by": null,5"api_version": "2010-04-01",6"caller_name": null,7"date_created": "Tue, 31 Aug 2010 20:36:28 +0000",8"date_updated": "Tue, 31 Aug 2010 20:36:44 +0000",9"direction": "inbound",10"duration": "15",11"end_time": "Tue, 31 Aug 2010 20:36:44 +0000",12"forwarded_from": "+141586753093",13"from": "+14158675308",14"from_formatted": "(415) 867-5308",15"group_sid": null,16"parent_call_sid": null,17"phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"price": "-0.03000",19"price_unit": "USD",20"sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"start_time": "Tue, 31 Aug 2010 20:36:29 +0000",22"status": "completed",23"subresource_uris": {24"notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",25"recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",26"payments": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",27"events": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",28"siprec": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",29"streams": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",30"transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",31"user_defined_message_subscriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",32"user_defined_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"33},34"to": "+14158675309",35"to_formatted": "(415) 867-5309",36"trunk_sid": null,37"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",38"queue_time": "1000"39}
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.
Note that an error will occur if you attempt to remove a call record for a call that is actively in progress.
The SID of the Account that created the Call resource(s) to delete.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided Call SID that uniquely identifies the Call resource to delete
^CA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteCall() {11await client.calls("CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();12}1314deleteCall();
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 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.