twilio
Twilio root: account management, API keys, sub-accounts, console, billing, rate limits, error codes
What this skill does
# twilio
## Purpose
Enable OpenClaw to operate Twilio “root” production workflows end-to-end: account and subaccount management, API keys and auth, console/billing/rate limits, and the operational patterns that sit on top (Messaging/Voice/Verify/SendGrid/Studio). This skill is for engineers who need to:
- Provision and rotate credentials safely (API Keys, Auth Tokens, SendGrid keys), including per-environment isolation.
- Debug and remediate production incidents (webhook failures, carrier errors, rate limits, invalid numbers, auth errors).
- Implement production-grade Messaging/Voice/Verify flows with correct compliance (STOP handling, 10DLC, toll-free verification).
- Control cost and performance (messaging services with geo-matching, concurrency, retry/backoff, recording/transcription costs).
- Automate Twilio operations via CLI + REST APIs + IaC patterns.
## Prerequisites
### Accounts and access
- Twilio account with Console access: https://console.twilio.com/
- For Messaging in US:
- A2P 10DLC brand + campaign registration (required for most US long-code messaging).
- Toll-free verification if using toll-free numbers for A2P.
- Short code approval if using short codes.
- For WhatsApp:
- WhatsApp Business Account (WABA) and Twilio WhatsApp sender configured.
- For Voice:
- A Twilio phone number with Voice capability.
- If using SIP trunking: Twilio Elastic SIP Trunking enabled.
- For Verify:
- Verify service created (Verify V2).
- For SendGrid:
- SendGrid account (can be separate from Twilio login), API key with appropriate scopes.
### Local tooling (exact versions)
- Node.js **20.11.1** (LTS) or **18.19.1** (LTS)
- Python **3.11.8** or **3.12.2**
- curl **8.5.0+**
- jq **1.7+**
- OpenSSL **3.0.13+** (for signature verification tooling)
- Docker **25.0.3+** (optional, for local webhook receivers and integration tests)
### Twilio SDKs (recommended pinned versions)
- Node: `twilio` **4.23.0**
- Python: `twilio` **9.0.5**
- SendGrid Node: `@sendgrid/mail` **8.1.1**
- SendGrid Python: `sendgrid` **6.11.0**
### Auth setup (Twilio)
Twilio supports:
- **Account SID** (starts with `AC...`)
- **Auth Token** (secret)
- **API Key SID** (starts with `SK...`) + **API Key Secret** (preferred over Auth Token for apps/CI)
- **Subaccounts** (each has its own Account SID/Auth Token; API Keys can be created per account)
Minimum recommended production posture:
- Use **API Key** + **Secret** in apps/CI.
- Keep **Auth Token** only for break-glass and console use; rotate if exposed.
- Separate **subaccounts** per environment (prod/stage/dev) and/or per tenant.
### Twilio CLI (optional but strongly recommended)
Twilio CLI is useful for interactive operations; for automation prefer REST + IaC, but CLI is still valuable for incident response.
- Twilio CLI: `twilio-cli` **5.17.0**
- Plugins:
- `@twilio-labs/plugin-serverless` **3.0.2** (for Twilio Functions/Assets)
- `@twilio-labs/plugin-flex` **6.0.6** (if using Flex)
Install via npm (see Installation & Setup).
## Core Concepts
### Accounts, subaccounts, projects
- **Account**: top-level billing entity. Identified by `AccountSid` (`AC...`).
- **Subaccount**: child account with its own credentials, numbers, messaging services, etc. Useful for environment isolation and tenant isolation.
- **Project**: Twilio Console UI grouping; not a separate security boundary. Don’t confuse with subaccounts.
Production pattern:
- One parent account for billing.
- Subaccounts per environment: `prod`, `staging`, `dev`.
- Optionally subaccounts per customer/tenant if you need strict isolation and separate phone number pools.
### Credentials
- **Auth Token**: master secret for an account. High blast radius.
- **API Keys**: scoped to an account; can be revoked without rotating Auth Token.
- **Key rotation**: create new key, deploy, verify, revoke old key.
### Messaging architecture
- **From** can be:
- A phone number (10DLC long code, toll-free, short code)
- A **Messaging Service SID** (`MG...`) which selects an appropriate sender (pooling, geo-match, sticky sender)
- **Status callbacks**: message lifecycle events via webhook:
- `queued`, `sent`, `delivered`, `undelivered`, `failed` (and sometimes `read` for channels that support it, e.g., WhatsApp)
- **STOP handling**:
- Twilio has built-in opt-out handling for many channels; you must not override it incorrectly.
- Your app should treat STOP as a compliance event and suppress future sends to that recipient unless they opt back in (e.g., START).
### Voice architecture
- **TwiML**: XML instructions returned by your webhook to control calls.
- `<Dial>`, `<Conference>`, `<Record>`, `<Say>` (with Polly voices), `<Gather>` for IVR.
- **Call status callbacks**: webhooks for call events.
- **Recording**: can be enabled per call or per conference; transcription is separate and has cost/latency.
- **SIP trunking**: connect PBX/SBC to Twilio; requires careful auth and IP ACLs.
### Verify V2
- Verify Service (`VA...`) defines channel configuration and policies.
- Verify checks are rate-limited and fraud-protected; you must handle `429` and Verify-specific error codes.
- Custom channels: email/push/TOTP can be integrated; treat as separate trust and deliverability domains.
### SendGrid
- Transactional vs marketing:
- Transactional: API-driven, low latency, templated.
- Marketing: campaigns, list management, compliance.
- Dynamic templates use Handlebars.
- Inbound Parse: webhook that turns inbound email into HTTP POST.
### Studio
- Studio Flows are state machines managed in Twilio.
- REST Trigger API can start a flow execution.
- Export/import flows for version control; A/B testing via Split widgets.
### Rate limits and retries
- Twilio enforces per-account and per-resource rate limits; you will see `20429` and HTTP `429`.
- Webhooks are retried by Twilio on non-2xx responses; your endpoints must be idempotent.
## Installation & Setup
### Official Python SDK
**Repository:** https://github.com/twilio/twilio-python
**PyPI:** https://pypi.org/project/twilio/ · **Supported:** Python 3.7–3.13
```shell
pip install twilio
```
```python
from twilio.rest import Client
import os
# Environment variables (recommended)
client = Client() # reads TWILIO_ACCOUNT_SID + TWILIO_AUTH_TOKEN
# API Key auth (preferred for production)
client = Client(
os.environ["TWILIO_API_KEY"],
os.environ["TWILIO_API_SECRET"],
os.environ["TWILIO_ACCOUNT_SID"]
)
# Regional edge routing
client = Client(region='au1', edge='sydney')
```
Source: [twilio/twilio-python — client auth](https://github.com/twilio/twilio-python/blob/main/README.md#api-credentials)
### Ubuntu 22.04 / 24.04 (x86_64)
Install dependencies:
```bash
sudo apt-get update
sudo apt-get install -y curl jq ca-certificates gnupg lsb-release openssl
```
Node.js 20.11.1 via NodeSource:
```bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v # expect v20.11.x
npm -v
```
Twilio CLI 5.17.0:
```bash
sudo npm install -g [email protected]
twilio --version
```
Optional plugins:
```bash
twilio plugins:install @twilio-labs/[email protected]
twilio plugins:install @twilio-labs/[email protected]
twilio plugins
```
Python 3.11 (if needed):
```bash
sudo apt-get install -y python3 python3-venv python3-pip
python3 --version
```
### Fedora 39 / 40 (x86_64)
```bash
sudo dnf install -y curl jq openssl nodejs npm python3 python3-pip
node -v
sudo npm install -g [email protected]
twilio --version
```
### macOS 14 (Sonoma) Intel
Homebrew:
```bash
brew update
brew install node@20 jq openssl@3 [email protected]
brew link --force --overwrite node@20
node -v
```
Twilio CLI:
```bash
npm install -g [email protected]
twilio --version
```
### macOS 14 (Sonoma) Apple Silicon (ARM64)
Same as Intel; ensure correct PATH:
```bash
brew install node@20 jq openssl@3 [email protected]
echo 'export PATH="/opt/homebrew/opt/node@20/bin:$PATH"' >> ~/.zshrc
souRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.