# Twilio

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

App · Messaging · 3 actions. Web page: https://docs.lodol.com/docs/integrations/twilio

## Actions

### 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 ID (`message_sid`, text, required): The unique ID of the message to look up (starts with SM). You get this back when you send a message.

**Outputs**

- `body` (text): The text content of the message, or empty if the message carries only media.
- `date_sent` (text): When Twilio sent the message, or empty if it has not been sent yet.
- `error_message` (text): A description of what went wrong if the message failed, or empty if there was no error.
- `from` (text): The phone number the message was sent from.
- `message_status` (text): Where the message is in delivery, such as queued, sending, sent, delivered, undelivered, or failed.
- `sid` (text): The unique ID of the message.
- `to` (text): The phone number the message was sent to.

**Example output**

```json
{
  "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 to (`to_number`, text): Only include messages sent to this phone number. Leave empty to include all recipients.
- Sent from (`from_number`, text): Only include messages sent from this Twilio phone number. Leave empty to include all senders.
- Maximum results (`limit`, number): How many messages to return, from 1 to 100. Defaults to 20. Default: `20`.

**Outputs**

- `messages` (list): The matching messages, newest first.

**Example output**

```json
{
  "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 to (`to_number`, text, required): The phone number to text, including the country code (for example, +15551234567).
- Send from (`from_number`, text, required): Your Twilio phone number (in +15551234567 format) or a Messaging Service SID (starts with MG) to send from.
- Message (`body`, text, required): The text of the message to send.

**Outputs**

- `from` (text): The phone number or messaging service the message was sent from.
- `message_status` (text): Where the message is in delivery, such as queued, sending, sent, delivered, or failed.
- `sid` (text): The unique ID Twilio assigned to this message (starts with SM).
- `to` (text): The phone number the message was sent to.

**Example output**

```json
{
  "from": "+15551234567",
  "message_status": "queued",
  "sid": "SM0a1b2c3d4e5f60718293a4b5c6d7e8f90",
  "to": "+15558675310"
}
```
