Appearance
Compatibility API
For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
The SignalWire Compatibility API provides a seamless migration path from Twilio* to SignalWire. If you’ve built applications using Twilio’s TwiML, REST API, or helper libraries, you can transition to SignalWire with minimal code changes while gaining access to SignalWire’s powerful infrastructure and competitive pricing.
Quick start migration
Migrating from Twilio to SignalWire typically requires just three changes:
1
Update your credentials
Replace your Twilio Account SID and Auth Token with your SignalWire Project ID and API Token from your SignalWire Dashboard.
2
Change the API endpoint
If using the Twilio REST API or SDK, update the base URL from api.twilio.com to your-space.signalwire.com, where your-space is your SignalWire Space name. This is not required if using the SignalWire Compatibility SDK.
3
Update webhook URLs
Point your phone number webhooks to your SignalWire Space. Your existing TwiML/cXML response handlers work without modification.
What’s included
The Compatibility API provides three main components:
cXML\ \ SignalWire’s XML-based language for controlling calls, messages, and faxes — directly compatible with Twilio’s TwiML. Client SDKs\ \ Helper libraries for generating cXML and making REST API calls in your preferred language. REST API\ \ RESTful endpoints for managing calls, messages, phone numbers, recordings, and more.
Migrating from Twilio
You can easily migrate from Twilio with minimal changes. Replace the Twilio client with the SignalWire client and update the from number to a valid SignalWire number.
Make sure to change the 'From' number!
When migrating to SignalWire, make sure to replace the from numbers with a valid SignalWire number.
// Replace these lines:
const twilio = require('twilio')
const response = new twilio.twiml.VoiceResponse()// With:
const { RestClient } = require('@signalwire/compatibility-api')
const response = new RestClient.LaML.VoiceResponse()Node.js
// Now use response like you did before!
response.say('Hey, welcome to SignalWire!')Supported features
The Compatibility API supports the full range of Twilio-compatible features:
| Category | Features |
|---|---|
| Voice | Inbound/outbound calls, call control, conferencing, queues, recordings, transcriptions |
| Messaging | SMS, MMS, status callbacks |
| Fax | Send and receive faxes |
| Phone Numbers | Purchase, configure, and manage phone numbers |
| Applications | Manage voice and messaging application configurations |
*Twilio and TwiML are trademarks of Twilio, Inc. SignalWire, Inc. and its products are not affiliated with or endorsed by Twilio, Inc.
Authorization
For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SignalWire REST APIs support two authentication methods: Basic Authentication and Bearer Authentication. Each endpoint specifies which method it accepts.
Basic authentication
Basic Authentication is the standard method for authenticating with SignalWire REST APIs, using your Project ID and API Token.
How it works
Include an Authorization header with each request:
Authorization: Basic <credentials>To build the credentials string:
- Join your Project ID and API Token with a colon:
ProjectID:APIToken - Base64 encode the result
Example
Given the Project ID a1b2c3d4-e5f6-7890-abcd-ef1234567890 and API Token 4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu:
# In the format username:password
<Badge type="tip" text="Fresh" />
a1b2c3d4-e5f6-7890-abcd-ef1234567890:4tjCGnmAeQ0hwFmFDhwfgww880X2lsnuR60VMyasGR3hFpSyvu
# Base64 encoded:
YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1
# Full header:
Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOjR0akNHbm1BZVEwaHdGbUZEaHdmZ3d3ODgwWDJsc251UjYwVk15YXNHUjNoRnBTeXZ1Finding your credentials
Your Project ID and API Tokens are available in the SignalWire Dashboard.
API credentials in the Dashboard.
API token scopes
Tokens can be scoped to limit API access. Select scopes when creating or editing a token in the Dashboard.
Getting a 401 Unauthorized? Check that your token has the required scope. Manage scopes in the SignalWire Dashboard.
cURL examples
cURL
# With base64-encoded credentials
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
-H 'Authorization: Basic YTFiMmMzZDQtZTVmNi03ODkwLWFiY2QtZWYxMjM0NTY3ODkwOlBUOWE4YjdjNmQ1ZTRmM2EyYjFj'
# Encoded inline using the Bash pipe operator
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
-H "Authorization: Basic $(echo -n "YourProjectId:YourApiToken" | base64)"
# Encoded inline with cURL's -u flag
curl https://{Your_Space_Name}.signalwire.com/api/laml/2010-04-01/Accounts/{YourProjectId}/Calls \
-u YourProjectId:YourApiTokenSecurity best practices
- Keep API credentials server-side. Use Bearer tokens for client applications.
- Set short token lifetimes to reduce risk if a token leaks.
- Scope tokens narrowly, only grant what’s needed.
- Always use HTTPS. Plain HTTP requests will fail.
- Rotate API tokens periodically from your Dashboard.
API credentials in the Dashboard.
