Twilio
Overview
The Twilio connector enables your Leena AI Agents to integrate with Twilio's communications platform, facilitating automated messaging workflows including SMS, MMS, and WhatsApp messages.
Twilio is a cloud communications platform that provides APIs for sending and receiving SMS, MMS, and WhatsApp messages programmatically. The Twilio connector allows Leena AI to automate messaging workflows, send notifications, and interact with customers seamlessly through various messaging channels.
API Details
Leena AI integrates with Twilio via REST APIs.
Documentation link: https://www.twilio.com/docs/iam/api
Setup
The Twilio connector uses HTTP Basic Authentication with Account SID and Auth Token.
Prerequisites
Before setting up the Twilio connector, ensure you have:
- An active Twilio account
- Access to your Twilio Console
- Twilio Account SID
- Twilio Auth Token
- Access to your Leena AI workspace with connector management permissions
Get credentials
Here is how to obtain your Twilio credentials:
- Log in to Twilio Console (Ensure you have an active account)
- Navigate to Account Dashboard:
- From the left sidebar, go to your Account section
- Your Account SID will be visible on the dashboard
- Locate Auth Token:
- Click on "View" next to Auth Token to reveal it
- Copy both Account SID and Auth Token for use in Leena AI
- Note Your Credentials:
-
Keep your Account SID and Auth Token secure
-
These will be used for authentication in Leena AI
-
Add connection
Here is how to add a connection on Leena AI:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "Twilio" and select it from the list to add its new connector
- Start configuring the connector
- ID: Unique identifier for the connector
- Name: Descriptive name for your Twilio connection
- Auth Type: Authentication method (Account SID and Auth Token)
- Account SID: Your Twilio Account SID from the console
- Auth Token: Your Twilio Auth Token from the console
- Save the connector configuration
-
Click Save to complete the setup
-
The connector will be activated and ready to use
-
Actions
The following actions are supported for the Twilio connector:
Send SMS
Initiates sending of SMS or MMS messages through Twilio. The Agent can leverage the skill (workflow), which has been designed to send messages via Twilio, once the user raises a query to do so.
Input Parameters
Here are the input parameters required to set up this action:
Mandatory
| Name | Description |
|---|---|
| To | Recipient phone number in E.164 format |
| From | Sender's Twilio phone number in E.164 format (required if not using Messaging Service SID) |
| Messaging Service SID | Messaging Service SID (starts with MG, 34 characters) - alternative to using a specific From number |
| Message | The text message to send (max 1,600 characters) |
| Content SID | Template SID (starts with HX, 34 characters) for sending pre-defined content templates |
Optional
| Name | Description |
|---|---|
| Media Url | URL of the media file for MMS messages (JPEG, PNG, GIF supported, 5MB max). Multiple media URLs can be provided. |
| Content Variables | JSON string with variable substitutions for content templates |
Here is a sample JSON input:
{
"To": "+14155238886",
"From": "+15557122661",
"Body": "Hello, this is a test SMS message from Twilio"
}Response
Upon successful message submission, the action returns the message details including:
- Message SID (unique identifier)
- Account SID
- Status (queued, sending, sent, delivered, failed, undelivered)
- Message body
- From and To phone numbers
- Date created and date sent
- Direction (outbound-api)
- Number of media attachments
- Number of segments
- API version
- Error code and error message (if applicable)
Updated about 19 hours ago
