3.7 KiB
3.7 KiB
Twilio Routing Reference
App name: twilio
Base URL proxied: api.twilio.com
API Path Pattern
/twilio/2010-04-01/Accounts/{AccountSid}/{resource}.json
Important: Most Twilio endpoints require your Account SID in the path. Get it from /Accounts.json.
Common Endpoints
Accounts
List Accounts
GET /twilio/2010-04-01/Accounts.json
Get Account
GET /twilio/2010-04-01/Accounts/{AccountSid}.json
Messages (SMS/MMS)
List Messages
GET /twilio/2010-04-01/Accounts/{AccountSid}/Messages.json
Send Message
POST /twilio/2010-04-01/Accounts/{AccountSid}/Messages.json
Content-Type: application/x-www-form-urlencoded
To=+15559876543&From=+15551234567&Body=Hello%20from%20Twilio!
Get Message
GET /twilio/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json
Delete Message
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.json
Calls (Voice)
List Calls
GET /twilio/2010-04-01/Accounts/{AccountSid}/Calls.json
Make Call
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
Get Call
GET /twilio/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}.json
End Call
POST /twilio/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}.json
Content-Type: application/x-www-form-urlencoded
Status=completed
Phone Numbers
List Incoming Phone Numbers
GET /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers.json
Get Phone Number
GET /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
Update Phone Number
POST /twilio/2010-04-01/Accounts/{AccountSid}/IncomingPhoneNumbers/{PhoneNumberSid}.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Updated%20Name
Applications
List Applications
GET /twilio/2010-04-01/Accounts/{AccountSid}/Applications.json
Create Application
POST /twilio/2010-04-01/Accounts/{AccountSid}/Applications.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=My%20App&VoiceUrl=https://example.com/voice
Delete Application
DELETE /twilio/2010-04-01/Accounts/{AccountSid}/Applications/{ApplicationSid}.json
Queues
List Queues
GET /twilio/2010-04-01/Accounts/{AccountSid}/Queues.json
Create Queue
POST /twilio/2010-04-01/Accounts/{AccountSid}/Queues.json
Content-Type: application/x-www-form-urlencoded
FriendlyName=Support%20Queue&MaxSize=100
Usage Records
List Usage Records
GET /twilio/2010-04-01/Accounts/{AccountSid}/Usage/Records.json
Pagination
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 next_page_uri for fetching next page.
Notes
- All endpoints require
/2010-04-01/API version prefix - Request bodies use
application/x-www-form-urlencoded(not JSON) - Phone numbers must be in E.164 format (+15551234567)
- SID prefixes: AC (account), SM/MM (messages), CA (calls), PN (phone numbers), AP (applications), QU (queues)
- POST is used for both creating and updating resources
- DELETE returns 204 No Content on success