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.