Compatibility API

A drop-in replacement for Twilio’s TwiML and REST APIs

View as Markdown

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:

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.

1// Replace these lines:
2const twilio = require('twilio')
3const response = new twilio.twiml.VoiceResponse()
1// With:
2const { RestClient } = require('@signalwire/compatibility-api')
3const response = new RestClient.LaML.VoiceResponse()
Node.js
1// Now use response like you did before!
2response.say('Hey, welcome to SignalWire!')

Supported features

The Compatibility API supports the full range of Twilio-compatible features:

CategoryFeatures
VoiceInbound/outbound calls, call control, conferencing, queues, recordings, transcriptions
MessagingSMS, MMS, status callbacks
FaxSend and receive faxes
Phone NumbersPurchase, configure, and manage phone numbers
ApplicationsManage voice and messaging application configurations