twilio-apiTwilio API integration with managed OAuth. SMS, voice calls, phone numbers, and communications. Use this skill when users want to send SMS messages, make voice calls, manage phone numbers, or work with Twilio resources. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
Install via ClawdBot CLI:
clawdbot install twilio-apiAccess the Twilio API with managed OAuth authentication. Send SMS messages, make voice calls, manage phone numbers, and work with Twilio resources.
# List all accounts
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/twilio/2010-04-01/Accounts.json')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
https://gateway.maton.ai/twilio/2010-04-01/Accounts/{AccountSid}/{resource}.json
The gateway proxies requests to api.twilio.com and automatically injects your OAuth token.
Important: Most Twilio endpoints require your Account SID in the path. You can get your Account SID from the /Accounts.json endpoint.
All requests require the Maton API key in the Authorization header:
Authorization: Bearer $MATON_API_KEY
Environment Variable: Set your API key as MATON_API_KEY:
export MATON_API_KEY="YOUR_API_KEY"
Manage your Twilio OAuth connections at https://ctrl.maton.ai.
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=twilio&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'twilio'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Response:
{
"connection": {
"connection_id": "ebe566b1-3eaf-4926-bc92-0d8d47445f12",
"status": "ACTIVE",
"creation_time": "2026-02-09T23:18:44.243582Z",
"last_updated_time": "2026-02-09T23:19:55.176687Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "twilio",
"metadata": {}
}
}
Open the returned url in a browser to complete OAuth authorization.
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If you have multiple Twilio connections, specify which one to use with the Maton-Connection header:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/twilio/2010-04-01/Accounts.json')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', 'ebe566b1-3eaf-4926-bc92-0d8d47445f12')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
If omitted, the gateway uses the default (oldest) active connection.
GET /twilio/2010-04-01/Accounts.json
Response:
{
"accounts": [
{
"sid": "ACf5d980cd4b3f7604a464afaec191fc60",
"friendly_name": "My first Twilio account",
"status": "active",
"date_created": "Mon, 09 Feb 2026 20:19:55 +0000",
"date_updated": "Mon, 09 Feb 2026 20:20:05 +0000"
}
]
}
GET /twilio/2010-04-01/Accounts/{AccountSid}.json
GET /twilio/2010-04-01/Accounts/{AccountSid}/Messages.json
Query Parameters:
PageSize - Number of results per page (default: 50)To - Filter by recipient phone numberFrom - Filter by sender phone numberDateSent - Filter by date sentResponse:
{
"messages": [
{
"sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"body": "Hello!",
"from": "+15551234567",
"to": "+15559876543",
"status": "delivered",
"date_sent": "Mon, 09 Feb 2026 21:00:00 +0000"
}
],
"page": 0,
"page_size": 50
}
GET /twilio/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json
POST /twilio/2010-04-01/Accounts/{AccountSid}/Messages.json
Content-Type: application/x-www-form-urlencoded
To=+15559876543&From=+15551234567&Body=Hello%20from%20Twilio!
Required Parameters:
To - Recipient phone number (E.164 format)From - Twilio phone number or messaging service SIDBody - Message text (max 1600 characters)Optional Parameters:
MessagingServiceSid - Use instead of From for message routingMediaUrl - URL of media to send (MMS)StatusCallback - Webhook URL for status updatesResponse:
{
"sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"body": "Hello from Twilio!",
"from": "+15551234567",
"to": "+15559876543",
"status": "queued",
"date_created": "Mon, 09 Feb 2026 21:00:00 +0000"
}
POST /twilio/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json
Content-Type: application/x-www-form-urlencoded
Body=
Setting Body to empty string redacts the message content.
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json
Returns 204 No Content on success.
GET /twilio/2010-04-01/Accounts/{AccountSid}/Calls.json
Query Parameters:
PageSize - Results per pageStatus - Filter by status (queued, ringing, in-progress, completed, etc.)To - Filter by recipientFrom - Filter by callerResponse:
{
"calls": [
{
"sid": "CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"from": "+15551234567",
"to": "+15559876543",
"status": "completed",
"duration": "60",
"direction": "outbound-api"
}
],
"page": 0,
"page_size": 50
}
GET /twilio/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}.json
POST /twilio/2010-04-01/Accounts/{AccountSid}/Calls.json
Content-Type: application/x-www-form-urlencoded
To=+15559876543&From=+15551234567&Url=https://example.com/twiml
Required Parameters:
To - Recipient phone numberFrom - Twilio phone numberUrl - TwiML application URLOptional Parameters:
StatusCallback - Webhook URL for call status updatesStatusCallbackEvent - Events to receive (initiated, ringing, answered, completed)Timeout - Seconds to wait for answer (default: 60)Record - Set to true to record the callPOST /twilio/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}.json
Content-Type: application/x-www-form-urlencoded
Status=completed
Use Status=completed to end an in-progress call.
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}.json
GET /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
Response:
{
"incoming_phone_numbers": [
{
"sid": "PNxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"phone_number": "+15551234567",
"friendly_name": "My Number",
"capabilities": {
"voice": true,
"sms": true,
"mms": true
}
}
]
}
GET /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
POST /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Updated%20Name&VoiceUrl=https://example.com/voice
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
GET /twilio/2010-04-01/Accounts/{AccountSid}/Applications.json
Response:
{
"applications": [
{
"sid": "APxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"friendly_name": "My App",
"voice_url": "https://example.com/voice",
"sms_url": "https://example.com/sms"
}
]
}
GET /twilio/2010-04-01/Accounts/{AccountSid}/Applications/{ApplicationSid}.json
POST /twilio/2010-04-01/Accounts/{AccountSid}/Applications.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=My%20App&VoiceUrl=https://example.com/voice
Response:
{
"sid": "APxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"friendly_name": "My App",
"voice_url": "https://example.com/voice",
"date_created": "Tue, 10 Feb 2026 00:20:15 +0000"
}
POST /twilio/2010-04-01/Accounts/{AccountSid}/Applications/{ApplicationSid}.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Updated%20App%20Name
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Applications/{ApplicationSid}.json
Returns 204 No Content on success.
GET /twilio/2010-04-01/Accounts/{AccountSid}/Queues.json
Response:
{
"queues": [
{
"sid": "QUxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"friendly_name": "Support Queue",
"current_size": 0,
"max_size": 1000,
"average_wait_time": 0
}
]
}
POST /twilio/2010-04-01/Accounts/{AccountSid}/Queues.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Support%20Queue&MaxSize=100
POST /twilio/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Updated%20Queue%20Name
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Queues/{QueueSid}.json
GET /twilio/2010-04-01/Accounts/{AccountSid}/Addresses.json
POST /twilio/2010-04-01/Accounts/{AccountSid}/Addresses.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Office&Street=123%20Main%20St&City=San%20Francisco&Region=CA&PostalCode=94105&IsoCountry=US&CustomerName=Acme%20Inc
GET /twilio/2010-04-01/Accounts/{AccountSid}/Usage/Records.json
Query Parameters:
Category - Filter by usage category (calls, sms, etc.)StartDate - Start date (YYYY-MM-DD)EndDate - End date (YYYY-MM-DD)Response:
{
"usage_records": [
{
"category": "sms",
"description": "SMS Messages",
"count": "100",
"price": "0.75",
"start_date": "2026-02-01",
"end_date": "2026-02-28"
}
]
}
Twilio uses page-based pagination:
GET /twilio/2010-04-01/Accounts/{AccountSid}/Messages.json?PageSize=50&Page=0
Parameters:
PageSize - Results per page (default: 50)Page - Page number (0-indexed)Response includes:
{
"messages": [...],
"page": 0,
"page_size": 50,
"first_page_uri": "/2010-04-01/Accounts/{AccountSid}/Messages.json?PageSize=50&Page=0",
"next_page_uri": "/2010-04-01/Accounts/{AccountSid}/Messages.json?PageSize=50&Page=1",
"previous_page_uri": null
}
Use next_page_uri to fetch the next page of results.
const response = await fetch(
'https://gateway.maton.ai/twilio/2010-04-01/Accounts.json',
{
headers: {
'Authorization': `Bearer ${process.env.MATON_API_KEY}`
}
}
);
const data = await response.json();
const accountSid = data.accounts[0].sid;
console.log(`Account SID: ${accountSid}`);
import os
import requests
# Get account SID
response = requests.get(
'https://gateway.maton.ai/twilio/2010-04-01/Accounts.json',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
account_sid = response.json()['accounts'][0]['sid']
print(f"Account SID: {account_sid}")
import os
import requests
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
response = requests.post(
f'https://gateway.maton.ai/twilio/2010-04-01/Accounts/{account_sid}/Messages.json',
headers={
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'Content-Type': 'application/x-www-form-urlencoded'
},
data={
'To': '+15559876543',
'From': '+15551234567',
'Body': 'Hello from Python!'
}
)
message = response.json()
print(f"Message SID: {message['sid']}")
print(f"Status: {message['status']}")
import os
import requests
account_sid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
response = requests.post(
f'https://gateway.maton.ai/twilio/2010-04-01/Accounts/{account_sid}/Calls.json',
headers={
'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
'Content-Type': 'application/x-www-form-urlencoded'
},
data={
'To': '+15559876543',
'From': '+15551234567',
'Url': 'https://demo.twilio.com/docs/voice.xml'
}
)
call = response.json()
print(f"Call SID: {call['sid']}")
print(f"Status: {call['status']}")
/2010-04-01/ API version prefixapplication/x-www-form-urlencoded format (not JSON)ACSM (SMS) or MM (MMS)CAPNAPQUjq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments| Status | Meaning |
|--------|---------|
| 400 | Missing Twilio connection or bad request |
| 401 | Invalid or missing Maton API key |
| 404 | Resource not found |
| 429 | Rate limited |
| 4xx/5xx | Passthrough error from Twilio API |
Twilio error responses include:
{
"code": 20404,
"message": "The requested resource was not found",
"more_info": "https://www.twilio.com/docs/errors/20404",
"status": 404
}
When you receive an "Invalid API key" error, ALWAYS follow these steps before concluding there is an issue:
MATON_API_KEY environment variable is set:echo $MATON_API_KEY
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Generated Mar 1, 2026
Businesses can use this skill to send automated SMS notifications for appointment reminders, order confirmations, or shipping updates. It integrates with Twilio's API to handle high-volume messaging, ensuring timely delivery and reducing manual effort. This is ideal for e-commerce, healthcare, or service-based industries.
Developers can implement 2FA by sending one-time passwords via SMS to enhance security for user logins or transactions. The skill simplifies OAuth management and API calls, allowing quick integration into authentication systems. This is useful for fintech, SaaS, or any application requiring secure access.
Companies can automate outbound voice calls for surveys, alerts, or customer support using Twilio's voice capabilities. The skill handles OAuth and routing, enabling scalable call management without complex infrastructure. This benefits industries like telecommunications, marketing, or public services.
Organizations can programmatically manage Twilio phone numbers for provisioning, updating, or releasing numbers as needed. This skill streamlines API interactions, making it easier to handle number inventory for campaigns or business lines. It's applicable in sales, logistics, or communication platforms.
Teams can monitor SMS and call logs in real-time to track communication performance, analyze metrics, or troubleshoot issues. The skill provides easy access to Twilio resources, enabling data-driven decisions for customer engagement. This suits industries like customer support, analytics, or media.
Companies can embed Twilio functionality into their SaaS products, offering messaging or calling features as add-ons. This skill reduces development time by handling authentication and API proxying, allowing focus on core services. Revenue is generated through subscription fees or usage-based pricing.
Marketing or tech agencies can use this skill to provide SMS marketing, automated notifications, or call services to clients. It enables quick setup and management of Twilio connections, scaling services across multiple accounts. Revenue comes from service contracts or project-based fees.
Developers can build and sell tools or scripts that leverage this skill for tasks like bulk messaging, call automation, or number management. The skill simplifies integration, making it accessible for indie developers or startups. Revenue is earned through one-time sales or licensing models.
💬 Integration Tip
Start by setting the MATON_API_KEY environment variable and creating a connection via the control panel; use the provided code snippets to test basic endpoints like listing accounts before scaling up.
iMessage/SMS CLI for listing chats, history, watch, and sending.
Use when you need to control Discord from Clawdbot via the discord tool: send messages, react, post or upload stickers, upload emojis, run polls, manage threads/pins/search, fetch permissions or member/role/channel info, or handle moderation actions in Discord DMs or channels.
Use when you need to control Slack from Clawdbot via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
Build or update the BlueBubbles external channel plugin for Clawdbot (extension package, REST send/probe, webhook inbound).
OpenClaw skill for designing Telegram Bot API workflows and command-driven conversations using direct HTTPS requests (no SDKs).