Twilio

App · Messaging · 16 actions

Send text messages and make phone calls that read out a message, then check how each one went, with Twilio.

Actions

ActionWhat it does
Cancel a scheduled text messageBeta.
Delete a call recordingBeta.
Delete a messageBeta.
Get a call recordingBeta.
Get call detailsLook up a phone call: whether it was answered, how long it lasted, and when it started and ended.
Get message detailsLook up the delivery status and details of a message you sent or received, including why it failed if it did not go through.
List call recordingsBeta.
List my phone numbersBeta.
List recent callsList your recent phone calls, newest first.
List recent messagesList your recent text messages, newest first.
Look up a phone numberBeta.
Make a phone callCall a phone number from your Twilio number and read out a message in a computer voice, then hang up.
Schedule a text messageBeta.
Send a picture messageBeta.
Send a text messageSend a text (SMS) message to a phone number from your Twilio phone number or messaging service.
Send a WhatsApp messageSend a WhatsApp message from your WhatsApp-enabled Twilio number.

Cancel a scheduled text message

Beta. Stop a scheduled text message from going out. Works until shortly before its send time.

Inputs

Message IDmessage_sidtextRequired
Beta. The scheduled message's ID (starts with SM), from 'Schedule a text message'.

Outputs

fromtext
Beta. The number or Messaging Service it's sent from.
message_statustext
Beta. Where the message is, such as scheduled, queued, sent, delivered, failed or canceled.
sidtext
Beta. The unique ID Twilio gave the message (starts with SM or MM).
totext
Beta. The phone number it goes to.
Example output
{
  "from": "MG0a1b2c3d4e5f60718293a4b5c6d7e8f9",
  "message_status": "canceled",
  "sid": "SM2c3d4e5f60718293a4b5c6d7e8f90a1b2",
  "to": "+15558675310"
}

Delete a call recording

Beta. Delete a call recording from your Twilio account. This can't be undone.

Inputs

Recording IDrecording_sidtextRequired
Beta. The recording's ID (starts with RE).

Outputs

deletedtrue/false
Beta. True once Twilio has deleted it.
sidtext
Beta. The ID of what was deleted.
Example output
{
  "deleted": true,
  "sid": "RE0a1b2c3d4e5f60718293a4b5c6d7e8f90"
}

Delete a message

Beta. Delete a message you sent or received from your Twilio logs, for example to keep customers' details out of them. This can't be undone, and it doesn't unsend the message.

Inputs

Message IDmessage_sidtextRequired
Beta. The message's ID (starts with SM or MM).

Outputs

deletedtrue/false
Beta. True once Twilio has deleted it.
sidtext
Beta. The ID of what was deleted.
Example output
{
  "deleted": true,
  "sid": "SM0a1b2c3d4e5f60718293a4b5c6d7e8f90"
}

Get a call recording

Beta. Look up one call recording: its call, length and link.

Inputs

Recording IDrecording_sidtextRequired
Beta. The recording's ID (starts with RE).

Outputs

call_sidtext
Beta. The ID of the call it recorded (starts with CA).
date_createdtext
Beta. When it was made.
duration_secondsnumber
Beta. How long it is, in seconds.
media_urltext
Beta. Twilio's link to the recording. It opens without signing in unless the account requires sign-in for recordings.
recording_statustext
Beta. completed when it's ready; processing, absent or failed otherwise.
sidtext
Beta. The recording's ID (starts with RE).
Example output
{
  "call_sid": "CA0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "date_created": "2026-11-02 18:30:05+00:00",
  "duration_seconds": 42,
  "media_url": "https://api.twilio.com/2010-04-01/Accounts/AC00000000000000000000000000000000/Recordings/RE0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "recording_status": "completed",
  "sid": "RE0a1b2c3d4e5f60718293a4b5c6d7e8f90"
}

Get call details

Look up a phone call: whether it was answered, how long it lasted, and when it started and ended.

Inputs

Call IDcall_sidtextRequired
The unique ID of the call to look up (starts with CA). You get this back when you make a call.

Outputs

call_statustext
Where the call is: queued, ringing, in-progress, completed (answered and ended), busy, no-answer, failed, or canceled.
duration_secondsnumber
How long the call lasted, in seconds, or empty until it ends.
end_timetext
When the call ended, or empty while it's going on.
fromtext
The phone number the call came from.
sidtext
The unique ID Twilio gave the call (starts with CA).
start_timetext
When the call was answered, or empty if it wasn't.
totext
The phone number that was called.
Example output
{
  "call_status": "completed",
  "duration_seconds": 34,
  "end_time": "2026-11-02 18:30:39+00:00",
  "from": "+15551234567",
  "sid": "CA0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "start_time": "2026-11-02 18:30:05+00:00",
  "to": "+15558675310"
}

Get message details

Look up the delivery status and details of a message you sent or received, including why it failed if it did not go through.

Inputs

Message IDmessage_sidtextRequired
The unique ID of the message to look up (starts with SM). You get this back when you send a message.

Outputs

bodytext
The text content of the message, or empty if the message carries only media.
date_senttext
When Twilio sent the message, or empty if it has not been sent yet.
error_messagetext
A description of what went wrong if the message failed, or empty if there was no error.
fromtext
The phone number the message was sent from.
message_statustext
Where the message is in delivery, such as queued, sending, sent, delivered, undelivered, or failed.
sidtext
The unique ID of the message.
totext
The phone number the message was sent to.
Example output
{
  "body": "Your appointment is confirmed for tomorrow at 2pm.",
  "date_sent": "2024-01-15 18:30:05+00:00",
  "error_message": null,
  "from": "+15551234567",
  "message_status": "delivered",
  "sid": "SM0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "to": "+15558675310"
}

List call recordings

Beta. List your Twilio call recordings, newest first, or only one call's.

Inputs

Call IDcall_sidtext
Beta. Only this call's recordings (the ID starts with CA). Leave empty for all recordings.
Maximum resultslimitnumber
Beta. How many recordings to list, from 1 to 100. Defaults to 20.Default: 20.

Outputs

recordingslist
Beta. The recordings, newest first.
Example output
{
  "recordings": [
    {
      "call_sid": "CA0a1b2c3d4e5f60718293a4b5c6d7e8f90",
      "date_created": "2026-11-02 18:30:05+00:00",
      "duration_seconds": 42,
      "media_url": "https://api.twilio.com/2010-04-01/Accounts/AC00000000000000000000000000000000/Recordings/RE0a1b2c3d4e5f60718293a4b5c6d7e8f90",
      "recording_status": "completed",
      "sid": "RE0a1b2c3d4e5f60718293a4b5c6d7e8f90"
    }
  ]
}

List my phone numbers

Beta. List the phone numbers in your Twilio account and whether each can send texts, send pictures and make calls.

Inputs

None.

Outputs

phone_numberslist
Beta. The account's phone numbers.
Example output
{
  "phone_numbers": [
    {
      "can_call": true,
      "can_send_pictures": true,
      "can_text": true,
      "friendly_name": "Front desk",
      "phone_number": "+15551234567",
      "sid": "PN0a1b2c3d4e5f60718293a4b5c6d7e8f90"
    }
  ]
}

List recent calls

List your recent phone calls, newest first. You can narrow the results to a number called or called from.

Inputs

Calledto_numbertext
Only include calls to this phone number. Leave empty to include every number.
Called fromfrom_numbertext
Only include calls from this phone number. Leave empty to include every number.
Maximum resultslimitnumber
How many calls to return, from 1 to 100. Defaults to 20.Default: 20.

Outputs

callslist
The matching calls, newest first.
Example output
{
  "calls": [
    {
      "call_status": "no-answer",
      "duration_seconds": 0,
      "end_time": "2026-11-02 18:31:10+00:00",
      "from": "+15551234567",
      "sid": "CA0a1b2c3d4e5f60718293a4b5c6d7e8f90",
      "start_time": null,
      "to": "+15558675310"
    }
  ]
}

List recent messages

List your recent text messages, newest first. You can narrow the results to a specific recipient or sender.

Inputs

Sent toto_numbertext
Only include messages sent to this phone number. Leave empty to include all recipients.
Sent fromfrom_numbertext
Only include messages sent from this Twilio phone number. Leave empty to include all senders.
Maximum resultslimitnumber
How many messages to return, from 1 to 100. Defaults to 20.Default: 20.

Outputs

messageslist
The matching messages, newest first.
Example output
{
  "messages": [
    {
      "body": "Your appointment is confirmed for tomorrow at 2pm.",
      "from": "+15551234567",
      "message_status": "delivered",
      "sid": "SM0a1b2c3d4e5f60718293a4b5c6d7e8f90",
      "to": "+15558675310"
    }
  ]
}

Look up a phone number

Beta. Check that a phone number is real and get it in standard (+15551234567) and local formats, free. Can also say whether it's a mobile, landline or internet number and who its carrier is, which Twilio charges a small fee for.

Inputs

Phone numberphone_numbertextRequired
Beta. The number to check, with its country code, or as written locally with the country below.
Countrycountry_codetext
Beta. The two-letter country code (such as US or GB) for a number written without its country code.
Check if it's a mobilecheck_line_typetrue/false
Beta. Also find out the line type and carrier. Twilio charges for each number checked this way.

Outputs

calling_country_codetext
Beta. The country's dialing code, such as 1.
carrier_nametext
Beta. The phone company, when the line type was checked; empty otherwise.
country_codetext
Beta. Its country, as a two-letter code.
line_typetext
Beta. mobile, landline, nonFixedVoip and the like, when the line type was checked; empty otherwise.
national_formattext
Beta. The number written the local way, such as (555) 123-4567.
phone_numbertext
Beta. The number in standard form, such as +15551234567.
validtrue/false
Beta. True when it's a real, possible phone number.
validation_errorslist
Beta. Why it isn't valid, such as TOO_SHORT. Empty when it is.
Example output
{
  "calling_country_code": "1",
  "carrier_name": "Example Wireless",
  "country_code": "US",
  "line_type": "mobile",
  "national_format": "(555) 123-4567",
  "phone_number": "+15551234567",
  "valid": true,
  "validation_errors": []
}

Make a phone call

Call a phone number from your Twilio number and read out a message in a computer voice, then hang up.

Inputs

Callto_numbertextRequired
The phone number to call, including the country code (for example, +15551234567).
Call fromfrom_numbertext
Your Twilio phone number to call from. It's the number the person sees. Beta: leave it blank to call from your account's own number. That works when the account has exactly one number that can make calls; with several, or none, the step stops without calling and asks for one to be chosen here. To choose, pick one of your numbers or type one in +15551234567 format. A Messaging Service can't make calls.
Message to read outmessagetextRequired
What to say when the call is answered. It's read out once, so put the most important part first. On a trial account, Twilio first plays a short notice and waits for a key press.

Outputs

call_statustext
Where the call is when it starts, usually queued. Use 'Get call details' to see how it ended.
fromtext
The phone number the call came from.
sidtext
The unique ID Twilio gave the call (starts with CA).
totext
The phone number that was called.
Example output
{
  "call_status": "queued",
  "from": "+15551234567",
  "sid": "CA0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "to": "+15558675310"
}

Schedule a text message

Beta. Have Twilio send a text message at a set time, between 15 minutes and 35 days from now, such as an appointment reminder. Scheduled texts go through a Twilio Messaging Service. Cancel it with 'Cancel a scheduled text message'.

Inputs

Send toto_numbertextRequired
Beta. The phone number to text, including the country code (for example, +15551234567).
MessagebodytextRequired
Beta. The text of the message.
Send atsend_atdate and timeRequired
Beta. When to send it: at least 15 minutes and at most 35 days from now.
Messaging Service SIDmessaging_service_sidtextRequired
Beta. The Messaging Service to send through: its SID starts with MG and is under Messaging > Services in Twilio. The service needs at least one of your numbers in it.

Outputs

fromtext
Beta. The number or Messaging Service it's sent from.
message_statustext
Beta. Where the message is, such as scheduled, queued, sent, delivered, failed or canceled.
sidtext
Beta. The unique ID Twilio gave the message (starts with SM or MM).
totext
Beta. The phone number it goes to.
Example output
{
  "from": "MG0a1b2c3d4e5f60718293a4b5c6d7e8f9",
  "message_status": "scheduled",
  "sid": "SM2c3d4e5f60718293a4b5c6d7e8f90a1b2",
  "to": "+15558675310"
}

Send a picture message

Beta. Send a picture message (MMS) with one or more images, and text if you like, to a phone number. Twilio sends picture messages to US and Canadian numbers; elsewhere the person gets a link to the picture instead.

Inputs

Send toto_numbertextRequired
Beta. The phone number to send to, including the country code (for example, +15551234567).
Picture linksmedia_urlstextRequired
Beta. A public link to each picture (JPG, PNG or GIF), one per line, up to 10. Twilio downloads each one, so the link must open without signing in.
Messagebodytext
Beta. Text to send with the pictures.
Send fromfrom_numbertext
Beta. Your Twilio number to send from; it must be able to send picture messages. Leave blank to use the account's only texting number, or type a Messaging Service SID (starts with MG).

Outputs

fromtext
Beta. The number or Messaging Service it's sent from.
message_statustext
Beta. Where the message is, such as scheduled, queued, sent, delivered, failed or canceled.
sidtext
Beta. The unique ID Twilio gave the message (starts with SM or MM).
totext
Beta. The phone number it goes to.
Example output
{
  "from": "+15551234567",
  "message_status": "queued",
  "sid": "MM0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "to": "+15558675310"
}

Send a text message

Send a text (SMS) message to a phone number from your Twilio phone number or messaging service.

Inputs

Send toto_numbertextRequired
The phone number to text, including the country code (for example, +15551234567).
Send fromfrom_numbertext
Your Twilio phone number to send from. Beta: leave it blank to send from your account's own number. That works when the account has exactly one number that can text; with several, or none, the step stops without sending and asks for one to be chosen here. To choose, pick one of your numbers, or type a number in +15551234567 format or a Messaging Service SID (starts with MG, from Messaging > Services in Twilio). A trial account sends from the number Twilio gave it in the Console's Try out SMS flow.
MessagebodytextRequired
The text of the message to send. A trial account can send only Twilio's templates, such as sms_appointment_reminders.

Outputs

fromtext
The phone number or messaging service the message was sent from.
message_statustext
Where the message is in delivery, such as queued, sending, sent, delivered, or failed.
sidtext
The unique ID Twilio assigned to this message (starts with SM).
totext
The phone number the message was sent to.
Example output
{
  "from": "+15551234567",
  "message_status": "queued",
  "sid": "SM0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "to": "+15558675310"
}

Send a WhatsApp message

Send a WhatsApp message from your WhatsApp-enabled Twilio number. WhatsApp delivers a message you write yourself only to someone who messaged that number in the last 24 hours.

Inputs

Send toto_numbertextRequired
The person's WhatsApp phone number, including the country code (for example, +15551234567).
Send fromfrom_numbertextRequired
Your Twilio number that's set up for WhatsApp (in +15551234567 format), or a Messaging Service SID (starts with MG) that includes it.
MessagebodytextRequired
The text of the message to send.

Outputs

fromtext
The WhatsApp number or messaging service it was sent from.
message_statustext
Where the message is in delivery, such as queued, sent, delivered, read, or failed.
sidtext
The unique ID Twilio assigned to this message (starts with SM).
totext
Who it was sent to, as whatsapp: and their number.
Example output
{
  "from": "whatsapp:+15551234567",
  "message_status": "queued",
  "sid": "SM1b2c3d4e5f60718293a4b5c6d7e8f90a1",
  "to": "whatsapp:+15558675310"
}

On this page