Migrate from Twilio

Step-by-step guide to migrating from Twilio to senderZ, with endpoint mapping, auth differences, and a dual-write cutover strategy.

If you are currently on Twilio and want to add iMessage support, simplify your billing, or eliminate 10DLC registration headaches, this guide walks you through every step of the migration. senderZ is designed to be a drop-in replacement for Twilio’s messaging APIs, with a simpler auth model, built-in compliance, and native iMessage delivery that Twilio does not offer.

Why Teams Migrate from Twilio

iMessage support. Twilio cannot send iMessages. Period. If your users are on iPhones (over 55% of US smartphone users), your Twilio SMS messages land in the green bubble — lower read rates, carrier filtering, and no read receipts. senderZ routes through iMessage first and falls back to SMS only when needed.

10DLC complexity. Twilio requires 10DLC registration for all A2P SMS traffic in the US. The registration process involves brand registration, campaign registration, carrier vetting, and ongoing compliance fees. With senderZ, iMessage traffic routes as P2P and does not require 10DLC registration.

Simpler pricing. Twilio charges per message segment, per phone number, plus carrier surcharges that change quarterly. senderZ charges a flat monthly fee with unlimited messages — no per-message math, no surprise bills.

Faster integration. Twilio’s API surface is enormous: Programmable Messaging, Conversations, Verify, Lookup, and dozens of add-ons. senderZ has one focused API for messaging, templates, contacts, and compliance. Most teams go from zero to production in under an hour.


Endpoint Mapping: Twilio to senderZ

The table below maps the Twilio endpoints you are most likely using to their senderZ equivalents.

Send a Message

TwiliosenderZ
EndpointPOST /2010-04-01/Accounts/{AccountSid}/Messages.jsonPOST /v1/messages
AuthBasic Auth (Account SID + Auth Token)Bearer token (Authorization: Bearer sz_live_xxx)
Body formatForm-encoded (To, From, Body, MessagingServiceSid)JSON (to, channel, body)
Phone numberYou must specify From or MessagingServiceSidAutomatic — senderZ picks the best phone from your pool
iMessageNot supportedAutomatic via channel: "auto"
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_SID/Messages.json" \
  -u "$TWILIO_SID:$TWILIO_TOKEN" \
  --data-urlencode "To=+15551234567" \
  --data-urlencode "From=+15559876543" \
  --data-urlencode "Body=Your verification code is 483920"
curl -X POST https://api.senderz.com/v1/messages \
  -H "Authorization: Bearer sz_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+15551234567",
    "channel": "auto",
    "body": "Your verification code is 483920"
  }'

Check Message Status

TwiliosenderZ
EndpointGET /2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}.jsonGET /v1/messages/{message_id}
Status valuesqueued, sending, sent, delivered, undelivered, failedqueued, sent, delivered, failed, blocked
iMessage statusN/AFull delivery + read receipt tracking

List Messages

TwiliosenderZ
EndpointGET /2010-04-01/Accounts/{AccountSid}/Messages.jsonGET /v1/messages
PaginationPageSize + Page paramslimit + page params
FilteringTo, From, DateSentstatus, channel, since

Webhooks (Status Callbacks)

TwiliosenderZ
RegistrationPer-message StatusCallback URL or Messaging Service configPOST /v1/webhooks (one-time registration)
FormatForm-encoded POSTJSON POST
SignatureTwilio signature header (HMAC-SHA1)X-Senderz-Signature header (HMAC-SHA256)
EventsMessageStatus callbackmessage.sent, message.delivered, message.failed, message.received

Opt-Out / Compliance

TwiliosenderZ
STOP handlingTwilio Advanced Opt-Out (requires Messaging Service)Built-in on every message — no configuration needed
Consent loggingNot included — you build it yourselfPOST /v1/compliance/consent
Opt-out listTwilio Console or API (limited)GET /v1/compliance/opt-outs + CSV export
Quiet hoursNot included — you build it yourselfAutomatic for marketing messages (8 PM - 8 AM local)

Authentication Differences

Twilio uses HTTP Basic Auth with your Account SID as the username and Auth Token as the password. Every request includes both credentials.

senderZ uses a single Bearer token. You create API keys in the developer portal, and each key is scoped to your tenant. There is no Account SID equivalent — your tenant is identified by the API key itself.

# Twilio
Authorization: Basic base64(ACCOUNT_SID:AUTH_TOKEN)

# senderZ
Authorization: Bearer sz_live_YOUR_API_KEY

If you are using Twilio’s sub-accounts for multi-tenant isolation, senderZ has native multi-tenant support. Each tenant gets isolated data, separate API keys, and independent phone number assignments — without managing sub-account credentials.


Webhook Signature Verification

If you verify Twilio webhook signatures (and you should), you will need to update your verification logic. Twilio uses HMAC-SHA1 over the full URL plus sorted POST parameters. senderZ uses HMAC-SHA256 over the raw JSON request body.

import twilio from 'twilio'

const isValid = twilio.validateRequest(
  authToken,
  req.headers['x-twilio-signature'],
  fullUrl,
  req.body
)
import { createHmac } from 'crypto'

const expected = createHmac('sha256', webhookSecret)
  .update(rawBody)
  .digest('hex')

const isValid = req.headers['x-senderz-signature'] === expected

What You Gain with senderZ

iMessage Delivery

This is the single biggest reason teams migrate. senderZ detects whether the recipient’s number supports iMessage and delivers via iMessage when possible. iMessage messages appear as blue bubbles, support read receipts, and bypass carrier filtering entirely. For US audiences where over half of users are on iPhones, this means dramatically better deliverability.

You can also explicitly check iMessage capability before sending:

curl https://api.senderz.com/v1/capabilities/+15551234567 \
  -H "Authorization: Bearer sz_live_YOUR_KEY"

No 10DLC Registration

Twilio requires 10DLC brand and campaign registration for all A2P SMS in the US. This process takes days to weeks, costs money, and can be rejected. senderZ’s iMessage delivery routes as P2P traffic and does not require 10DLC. SMS fallback through senderZ’s dedicated devices also routes as P2P, though at very high SMS volumes you may want to consider carrier registration.

Built-In Compliance

Twilio gives you the building blocks (Advanced Opt-Out, phone number management) but you assemble the compliance logic yourself. senderZ handles STOP/START keyword processing, quiet hours enforcement, consent logging, and opt-out blocking at the infrastructure level. You do not write a single line of compliance code.

Flat Pricing

No more calculating cost per message segment, per phone number, per carrier surcharge. senderZ plans are flat monthly fees with unlimited messages. See Pricing for details.


Migration Strategy: Dual-Write Cutover

The safest way to migrate is a dual-write approach: send every message through both Twilio and senderZ for a testing period, compare delivery results, then cut over fully once you are confident.

Phase 1: Shadow Mode (1-2 weeks)

Send all production messages through Twilio as usual. Simultaneously send a copy through senderZ to an internal test number. Compare delivery speed, status callbacks, and reliability.

async function sendMessage(to: string, body: string) {
  // Production: Twilio (still primary)
  const twilioResult = await twilioClient.messages.create({
    to,
    from: TWILIO_NUMBER,
    body,
  })

  // Shadow: senderZ (testing)
  const senderzResult = await fetch('https://api.senderz.com/v1/messages', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${SENDERZ_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ to, channel: 'auto', body }),
  })

  // Log both results for comparison
  logDeliveryComparison(twilioResult, await senderzResult.json())

  return twilioResult // Twilio still primary
}

Phase 2: Split Traffic (1 week)

Route 10% of production traffic through senderZ and 90% through Twilio. Monitor delivery rates, webhook reliability, and response times. Increase senderZ’s share as confidence grows.

async function sendMessage(to: string, body: string) {
  if (Math.random() < 0.1) {
    // 10% through senderZ
    return sendViaSenderz(to, body)
  }
  // 90% through Twilio
  return sendViaTwilio(to, body)
}

Phase 3: Full Cutover

Once senderZ delivery rates match or exceed Twilio (they will, thanks to iMessage), switch 100% of traffic. Keep your Twilio account active for 30 days as a rollback option, then cancel.


SDK Migration

If you are using the Twilio Node.js SDK, swapping to the senderZ SDK is straightforward.

import twilio from 'twilio'

const client = twilio(accountSid, authToken)

const message = await client.messages.create({
  to: '+15551234567',
  from: '+15559876543',
  body: 'Hello from Twilio',
})

console.log(message.sid)
import { SenderZ } from '@senderz/sdk'

const client = new SenderZ({ apiKey: 'sz_live_YOUR_KEY' })

const message = await client.messages.send({
  to: '+15551234567',
  channel: 'auto',
  body: 'Hello from senderZ',
})

console.log(message.id)

Key differences in the SDK:

  • No from number needed — senderZ auto-selects from your phone pool
  • channel: 'auto' enables iMessage-first routing
  • Error responses follow a consistent { error, code, message } shape
  • Webhook verification is built into the SDK: client.webhooks.verify(payload, signature)

Phone Number Porting

If you own phone numbers on Twilio that your customers already know, you may want to port them to a physical SIM for use with senderZ. The porting process works like any carrier-to-carrier port:

  1. Request a port-out from Twilio. In the Twilio Console, navigate to Phone Numbers > Manage > Active Numbers, select the number, and submit a port-out request.
  2. Provide the LOA (Letter of Authorization) to your new carrier (the carrier providing the SIM for your senderZ device).
  3. Wait for the port to complete. This typically takes 1-3 business days for US numbers.
  4. Activate the SIM on your senderZ-connected device and register the number via POST /admin/phones.

If you do not want to port your numbers, you can start fresh with new numbers on senderZ. Since senderZ delivers via iMessage (which shows your contact name, not just the number), recipients often do not notice or care about the number change.


Migrating Contacts and Opt-Outs

Contacts

Export your contact data from Twilio or your CRM. Import into senderZ via POST /v1/contacts for each contact, or use the CSV import in the developer portal.

Opt-Outs

This is critical. If someone opted out of your Twilio messages, they must remain opted out on senderZ. Export your Twilio opt-out list from the Twilio Console (Messaging > Opt-Out Management), then import each opted-out number into senderZ. The senderZ router will block sends to these numbers automatically.

If you have TCPA consent records (you should), log them into senderZ via POST /v1/compliance/consent during migration. Include the original consent date and source. See the Consent Management guide for details.


Webhook Migration Checklist

  1. Register your webhook URL with senderZ: POST /v1/webhooks
  2. Update your webhook handler to accept JSON payloads (instead of Twilio’s form-encoded)
  3. Update signature verification from Twilio’s HMAC-SHA1 to senderZ’s HMAC-SHA256
  4. Map status values: Twilio’s undelivered maps to senderZ’s failed; senderZ adds blocked for compliance holds
  5. Test with a few messages before going live

Timeline

Most teams complete the migration in under a week:

DayActivity
Day 1Sign up, get API key, send test messages
Day 2-3Update webhook handlers, run shadow mode
Day 4-5Split traffic 10/90, monitor results
Day 6-7Full cutover, port numbers if needed

Frequently Asked Questions

Can I keep using Twilio for voice and use senderZ for messaging? Yes. Many teams use Twilio for voice calls and senderZ for messaging. The two services are completely independent. senderZ plans to add voice support (via Twilio Voice API) in a future release, at which point you could consolidate.

Does senderZ support Twilio Verify (OTP)? senderZ does not have a dedicated Verify product, but you can send OTP codes using templates. Create an OTP template with POST /v1/templates and send it with POST /v1/messages using template variables. The delivery is faster than Twilio Verify for iPhone users because senderZ delivers OTPs via iMessage.

What about Twilio Conversations? senderZ handles two-way messaging natively. Inbound messages trigger webhooks to your server, and you can reply via the same API. There is no separate “Conversations” product — it is all one API.

Will my Twilio phone numbers work with senderZ? You need to port them to a physical SIM card. senderZ uses dedicated Apple devices for delivery, so the number must be on a real carrier SIM. See the Phone Number Porting section above.

Is there a cost to migrate? No. senderZ does not charge migration fees. You pay your normal plan fee and that includes unlimited messages from day one. The Migration Concierge service is also free for Growth and Scale plan customers.