Twilio Integration
Send WhatsApp messages programmatically with Twilio integration for both free-form and template-based messaging.
Timbal integrates with Twilio to enable sending WhatsApp messages programmatically.
This integration allows you to send both free-form and template-based WhatsApp messages directly from your Timbal workflows.
Prerequisites
Before using the Twilio integration, you'll need:
- A Twilio account – Sign up here
- A WhatsApp-enabled Twilio phone number
- Your Twilio Account SID, Auth Token, and WhatsApp From number
- Store your credentials in environment variables:
TWILIO_ACCOUNT_SID
,TWILIO_AUTH_TOKEN
,TWILIO_PHONE_NUMBER
Send WhatsApp Message
Description
The send_whatsapp_message step allows you to send a free-form WhatsApp message to a user.
Example
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
to | str | The WhatsApp account to send the message to in E.164 format | Yes |
message | str | The message to send (max 1600 characters; longer messages will be split) | Yes |
Send WhatsApp Template
Description
The send_whatsapp_template step allows you to send a pre-approved WhatsApp template message to a user, with parameters.
Example
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
to | str | The WhatsApp account to send the message to in E.164 format | Yes |
template_sid | str | The template SID to send the message with | Yes |
template_params | dict | Parameters to fill in the template (must match template definition) | Yes |
Agent Integration Example
Notes
- For more advanced usage, see the Twilio WhatsApp API documentation.