# Twilio (/integrations/twilio)





{/* MANUAL-CONTENT-START:intro */}

Use Twilio triggers in Sim to start workflows from messaging events. **Message Status** reports status changes for a sent message, including its SID and any error code. **SMS Received** provides the sender, recipient, body, and media from an inbound SMS or MMS.

{/* MANUAL-CONTENT-END */}

## Triggers [#triggers]

A trigger starts a workflow when a supported event occurs in this service.

### Twilio Message Status [#twilio-message-status]

Trigger workflow when a Twilio message status changes (sent, delivered, failed)

<ReferenceDetails label="Configuration and outputs">
  #### Configuration [#configuration]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `accountSid` | string | Yes | Your Twilio Account SID from the Twilio Console |
  | `authToken` | string | Yes | Your Twilio Auth Token, used to verify the X-Twilio-Signature header |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `messageSid` | string | Unique 34-character identifier for the message |
  | `accountSid` | string | Twilio Account SID |
  | `messagingServiceSid` | string | Messaging Service SID, if the message was sent through one |
  | `from` | string | Phone number or channel address that sent the message (E.164 format) |
  | `to` | string | Phone number or channel address of the recipient (E.164 format) |
  | `body` | string | Text body of the message (up to 1600 characters) |
  | `numMedia` | string | Number of media items attached to the message |
  | `numSegments` | string | Number of segments that make up the message |
  | `media` | json | Array of attached media as \{ url, contentType } objects (MMS) |
  | `smsStatus` | string | SMS status (e.g., received, sent, delivered, undelivered, failed) |
  | `messageStatus` | string | Message status for status callbacks (sent, delivered, undelivered, failed) |
  | `errorCode` | string | Twilio error code, present when the status is failed or undelivered |
  | `apiVersion` | string | Twilio API version used to process the message |
  | `fromCity` | string | City of the sender, when available |
  | `fromState` | string | State/province of the sender, when available |
  | `fromZip` | string | Zip/postal code of the sender, when available |
  | `fromCountry` | string | Country of the sender, when available |
  | `toCity` | string | City of the recipient, when available |
  | `toState` | string | State/province of the recipient, when available |
  | `toZip` | string | Zip/postal code of the recipient, when available |
  | `toCountry` | string | Country of the recipient, when available |
  | `raw` | string | Complete raw webhook payload from Twilio as a JSON string |
</ReferenceDetails>

### Twilio SMS Received [#twilio-sms-received]

Trigger workflow when an inbound SMS or MMS message is received via Twilio

<ReferenceDetails label="Configuration and outputs">
  #### Configuration [#configuration-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `accountSid` | string | Yes | Your Twilio Account SID from the Twilio Console |
  | `authToken` | string | Yes | Your Twilio Auth Token, used to verify the X-Twilio-Signature header |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `messageSid` | string | Unique 34-character identifier for the message |
  | `accountSid` | string | Twilio Account SID |
  | `messagingServiceSid` | string | Messaging Service SID, if the message was sent through one |
  | `from` | string | Phone number or channel address that sent the message (E.164 format) |
  | `to` | string | Phone number or channel address of the recipient (E.164 format) |
  | `body` | string | Text body of the message (up to 1600 characters) |
  | `numMedia` | string | Number of media items attached to the message |
  | `numSegments` | string | Number of segments that make up the message |
  | `media` | json | Array of attached media as \{ url, contentType } objects (MMS) |
  | `smsStatus` | string | SMS status (e.g., received, sent, delivered, undelivered, failed) |
  | `messageStatus` | string | Message status for status callbacks (sent, delivered, undelivered, failed) |
  | `errorCode` | string | Twilio error code, present when the status is failed or undelivered |
  | `apiVersion` | string | Twilio API version used to process the message |
  | `fromCity` | string | City of the sender, when available |
  | `fromState` | string | State/province of the sender, when available |
  | `fromZip` | string | Zip/postal code of the sender, when available |
  | `fromCountry` | string | Country of the sender, when available |
  | `toCity` | string | City of the recipient, when available |
  | `toState` | string | State/province of the recipient, when available |
  | `toZip` | string | Zip/postal code of the recipient, when available |
  | `toCountry` | string | Country of the recipient, when available |
  | `raw` | string | Complete raw webhook payload from Twilio as a JSON string |
</ReferenceDetails>
