
Twilio SendMessage
CertifiedSend an RCS message via Twilio
Twilio SendMessage
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.
type: io.kestra.plugin.twilio.notify.rcs.SendMessageExamples
Send an RCS alert on a failed flow execution.
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.
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
accountSID *Requiredstring
Twilio Account SID
The Account SID used for basic authentication and to construct the Messages API URL
authToken *Requiredstring
Twilio Auth Token
The Auth Token paired with the Account SID; store as a Kestra secret
to *Requiredstring
Recipient phone number
The destination phone number in E.164 format, e.g. +15555550100
body string
Message body
The text content of the message
contentSid string
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
from string
Sender phone number
The Twilio phone number, alphanumeric sender ID, or short code to send from. Mutually exclusive with messagingServiceSid
messagingServiceSid string
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
Options
Optional HTTP client overrides for timeouts, charset, headers, and max content length
io.kestra.plugin.twilio.AbstractTwilioConnection-RequestOptions
Connect timeout
Time allowed to establish the HTTP connection before failing
PT0SConnection pool idle timeout
Time an idle pooled connection stays open before closing; defaults to 0s (no TTL)
UTF-8Default request charset
Charset applied to requests when not specified; defaults to UTF-8
java.nio.charset.Charset
HTTP headers
HTTP headers to include in the request
10485760Max response size
Maximum response content length in bytes; defaults to 10MB
PT5MRead idle timeout
How long a read connection may stay idle before closing; defaults to 5m
PT10SRead timeout
Maximum time to read data before failing; defaults to 10s
Outputs
sid string
Twilio message SID
Unique identifier assigned by Twilio to the sent message
status string
Message status
Delivery status returned by Twilio, e.g. queued, sent, delivered