Twilio

App · Messaging · 3 actions

Send text messages, check delivery details, and review your recent message history with Twilio.

Actions

ActionWhat it does
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 recent messagesList your recent text messages, newest first.
Send a text messageSend a text (SMS) message to a phone number from your Twilio phone number or messaging service.

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 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"
    }
  ]
}

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_numbertextRequired
Your Twilio phone number (in +15551234567 format) or a Messaging Service SID (starts with MG) to send from.
MessagebodytextRequired
The text of the message to send.

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"
}

On this page