Twilio
Send SMS messages and make phone calls with Twilio.
On this page
Connect
Auth type: Credentials form (custom_auth). Pass the fields the provider needs (listed below) as the connection's credentials. They are sealed at rest.
| Field | Type | Description |
|---|---|---|
accountSidrequired | text | Your Twilio Account SID |
authTokenrequired | secret | Your Twilio Auth Token |
- From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
- Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
- Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.
Call it from a workflow
step.ctx.integrations.invoke("twilio", action, input) resolves with the provider's answer and rejects when Twilio isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. send_sms runs in the platform itself; the other actions run through the integration runner, which the server's operator turns on.
// workflows/notify.ts: call Twilio when a booking is confirmed
import { on } from "@appbricx/workflows";
export const tellTwilio = on.transition("booking", "status", "confirmed", async (_event, step) => {
// Recorded once: a retry doesn't send it twice. Rejects when Twilio isn't connected.
const output = await step.run("Twilio", () =>
step.ctx.integrations.invoke("twilio", "get_message", {
"message_sid": "<message sid>"
}),
);
step.ctx.log("Twilio answered", output);
});{
"name": "integrations",
"arguments": {
"project_id": "<project-id>",
"action": "call",
"piece": "twilio",
"piece_action": "get_message",
"input": {
"message_sid": "<message sid>"
},
"env": "dev"
}
}curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/twilio/get_message" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"message_sid":"<message sid>"}}'Actions
get_message
Get Message. Retrieves the details of a specific message.
| Input | Type | Description |
|---|---|---|
message_sidrequired | text | The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM". |
make_call
Call Phone. Call a number and say a message.
| Input | Type | Description |
|---|---|---|
fromrequired | id (picked from your account) | The phone number to send the message from |
torequired | text | The phone number to call. Must be in E.164 format (e.g., +15558675310). |
messagerequired | long text | The text message to be converted to speech and spoken to the recipient. |
voiceoptional | one of "alice" | "man" | "woman" | The voice to use for the text-to-speech message. |
languageoptional | one of "en-US" | "en-GB" | "es-ES" | "fr-FR" | "de-DE" | The language to use for the text-to-speech message. |
sendDigitsoptional | text | A string of keys to dial after the call is connected. Use 'w' for a half-second pause. |
timeoutoptional | number | The number of seconds to let the phone ring before assuming no answer. Default is 60. |
send_smsbuilt in
Send SMS. Send a new SMS message
| Input | Type | Description |
|---|---|---|
fromrequired | id (picked from your account) | The phone number to send the message from |
bodyrequired | text | The body of the message to send |
torequired | text | The phone number to send the message to |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
download_recording_media
Download Recording Media. Download the media file for a specific recording.
| Input | Type | Description |
|---|---|---|
recording_sidrequired | text | The unique identifier (SID) of the recording to download. It starts with "RE". |
formatoptional | one of "mp3" | "wav" | The desired audio format for the download file. |
channelsoptional | one of "1" | "2" | Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings. |
phone_number_lookup
Phone Number Lookup. Lookup information about a phone number.
| Input | Type | Description |
|---|---|---|
phone_numberrequired | text | Phone Number |
Details
- Id
twilio- Category
- Communication
- Tags
- sms, voice, phone, messaging
- Package
@activepieces/piece-twilio@0.4.5- Runs
- send_sms in the platform; the rest through the integration runner