Twilio SendMessage

Twilio SendMessage

Certified

Send an RCS message via Twilio

Posts a message to the Twilio Messages API through a Messaging Service that has an RCS sender, using Account SID and Auth Token for basic authentication. Twilio falls back to SMS when the recipient's device or carrier does not support RCS, so the same task covers both cases without extra configuration. Set body for a plain text message, contentSid to send a rich RCS content template, or both. Returns the Twilio message SID and delivery status from the API response. See the Twilio RCS documentation for details.

yaml
type: io.kestra.plugin.twilio.notify.rcs.SendMessage

Send an RCS alert on a failed flow execution.

yaml
id: alert_on_failure
namespace: company.team

tasks:
  - id: risky_step
    type: io.kestra.plugin.scripts.shell.Commands
    runner: PROCESS
    commands:
      - exit 1

errors:
  - id: send_rcs_alert
    type: io.kestra.plugin.twilio.notify.rcs.SendMessage
    accountSID: "{{ secret('TWILIO_ACCOUNT_SID') }}"
    authToken: "{{ secret('TWILIO_AUTH_TOKEN') }}"
    messagingServiceSid: "{{ secret('TWILIO_MESSAGING_SERVICE_SID') }}"
    to: "+15555550100"
    body: "Flow {{ flow.id }} failed on execution {{ execution.id }}."

Send a rich RCS message using a content template.

yaml
id: rcs_rich_notification
namespace: company.team

inputs:
  - id: recipient
    type: STRING

tasks:
  - id: send_message
    type: io.kestra.plugin.twilio.notify.rcs.SendMessage
    accountSID: "{{ secret('TWILIO_ACCOUNT_SID') }}"
    authToken: "{{ secret('TWILIO_AUTH_TOKEN') }}"
    messagingServiceSid: "{{ secret('TWILIO_MESSAGING_SERVICE_SID') }}"
    to: "{{ inputs.recipient }}"
    contentSid: "{{ secret('TWILIO_CONTENT_SID') }}"

  - id: log_result
    type: io.kestra.plugin.core.log.Log
    message: "Message sent. SID: {{ outputs.send_message.sid }}, status: {{ outputs.send_message.status }}"
Properties

Twilio Account SID

The Account SID used for basic authentication and to construct the Messages API URL

Twilio Auth Token

The Auth Token paired with the Account SID; store as a Kestra secret

Recipient phone number

The destination phone number in E.164 format, e.g. +15555550100

Message body

The text content of the message

Content template SID

SID of a Twilio Content API template (HX...) to render as a rich RCS message. Either this or body must be set

Sender phone number

The Twilio phone number, alphanumeric sender ID, or short code to send from. Mutually exclusive with messagingServiceSid

Messaging Service SID

SID of a Twilio Messaging Service (MG...) to send through, which picks the sender from the service's pool. Required for channels configured on a Messaging Service, such as RCS. Mutually exclusive with from

Options

Optional HTTP client overrides for timeouts, charset, headers, and max content length

Definitions
connectTimeoutstring

Connect timeout

Time allowed to establish the HTTP connection before failing

connectionPoolIdleTimeoutstring
DefaultPT0S

Connection pool idle timeout

Time an idle pooled connection stays open before closing; defaults to 0s (no TTL)

defaultCharsetstring
DefaultUTF-8

Default request charset

Charset applied to requests when not specified; defaults to UTF-8

headersobject

HTTP headers

HTTP headers to include in the request

maxContentLengthintegerstring
Default10485760

Max response size

Maximum response content length in bytes; defaults to 10MB

readIdleTimeoutstring
DefaultPT5M

Read idle timeout

How long a read connection may stay idle before closing; defaults to 5m

readTimeoutstring
DefaultPT10S

Read timeout

Maximum time to read data before failing; defaults to 10s

Twilio message SID

Unique identifier assigned by Twilio to the sent message

Message status

Delivery status returned by Twilio, e.g. queued, sent, delivered