Twilio
Send SMS text messages and read message history through the Twilio SMS REST API.
- Base URL:
https://api.twilio.com/2010-04-01 - Auth: HTTP Basic — username:password is your
AccountSid:AuthToken(anAPIKeySID:APIKeySecretpair also works). No OAuth, no business account. - Standard library only — no external Python packages.
Operations
| operation | Twilio call | Required params | What it does |
|---|---|---|---|
send |
POST /Accounts/{AccountSid}/Messages |
to, from, body |
Send an SMS text message |
list |
GET /Accounts/{AccountSid}/Messages |
— (optional pageSize) |
List recent messages on the account |
get |
GET /Accounts/{AccountSid}/Messages/{Sid} |
messageSid |
Look up one message (delivery status, etc.) |
The Account SID is taken from the part of apiKey before the colon and used as
the /Accounts/{AccountSid}/ path segment, so a single apiKey value carries
both the credential and the routing account.
apiKey setup
- Sign in to the Twilio Console.
- On the dashboard, copy your Account SID (starts with
AC...) and your Auth Token. - Set
apiKeyto the two joined with a colon:ACxxxxxxxx...:your_auth_token.
For finer-grained access you can instead create an API Key (Console →
Account → API keys & tokens). Use APIKeySID:APIKeySecret, but still pass the
Account SID as the routing account by formatting apiKey as
AccountSid:APIKeySecret when the key SID and account differ.
Examples
Send an SMS
operation: send
apiKey: ACxxxxxxxxxxxxxxxx:your_auth_token
to: +15558675310
from: +15017122661
body: Your InTouch job finished successfully.
Returns the created message resource (including sid, status, price).
List the last 5 messages
operation: list
apiKey: ACxxxxxxxxxxxxxxxx:your_auth_token
pageSize: 5
Returns { "messages": [ ... ] }.
Output
Both publish:
result— the Twilio response body as a JSON string.status— the HTTP status code (e.g.201for a successful send,200for reads).
On any error the step prints {"error": "..."} and exits non-zero, marking the
YAML step FAILED.
Publishes
The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.
errorresultstatus
Input Properties
Every property this tool accepts, from its own tool.iml.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | yes | — | DEPRECATED — bind an API Key credential to the task with credentialName instead. A key pasted here is stored in the workflow definition in clear and appears in every export of it. Still honoured for workflows built before the change. |
operation |
string | yes | — | One of: send, list, get |
to |
string | no | — | Recipient phone number in E.164 format (e.g. +15558675310). Required for 'send'. |
from |
string | no | — | Sender Twilio phone number in E.164 format. Required for 'send'. |
messageSid |
string | no | — | Message SID (starts with SM...). Required for 'get'. |
pageSize |
string | no | 20 |
Max number of messages to return for 'list' (1-1000). |