Before you start
You need a Notilify API key.
Minute 1: get your Notilify API key
Create an API key in Notilify and make it available to your application asNOTILIFY_API_KEY.
Minute 2: replace the send call
Keep your application-facing function unchanged. Replace only the provider adapter behind it.
async function sendWithNotilify({ from, to, body, requestId }) {
const response = await fetch("https://api.notilify.com/v1/message", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NOTILIFY_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": requestId
},
body: JSON.stringify({ from, to, message: body })
});
if (!response.ok) throw new Error(`Notilify returned ${response.status}`);
const result = await response.json();
return { provider: "notilify", messageId: result.data.message_id };
}| Twilio | Notilify | Migration note |
|---|---|---|
| Account SID + Auth Token | Bearer API key | Use the Authorization header |
| Body | message | Keep the same SMS text |
| To | to | Keep the number in E.164 format |
| From | from | Use an approved sender ID or purchased number |
| MessageSid | data.message_id | Store this as your provider message ID |
| StatusCallback | Configured webhook | Register one delivery webhook |
Minute 3: map the response
Replace the Twilio MessageSid with Notilify'sdata.message_id wherever you store or return the provider message ID.
Pass your existing request ID as the Idempotency-Key.
Minute 4: move delivery events
Register your delivery endpoint once instead of attaching a callback URL to every send.
curl -X POST https://api.notilify.com/v1/webhook \
-H "Authorization: Bearer $NOTILIFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/notilify",
"enabled": true,
"secret": "use-a-long-random-secret"
}'Store event_id for deduplication and message_id for correlation. Return success quickly, then process the event asynchronously.
| Twilio status | Notilify status | Application status |
|---|---|---|
| queued / accepted | queued | pending |
| sent | sent | sent |
| delivered | delivered | delivered |
| failed / undelivered | failed | failed |
| No direct equivalent | retrying | pending |
Minute 5: send a test message
- Send one message through the updated application path.
- Confirm the API returns
data.message_id. - Confirm the delivery event reaches your webhook.
Once those checks pass, route your transactional SMS sends through Notilify.
If you use Twilio Verify
Twilio Verify manages code generation and verification as well as message delivery. Keep it active until your application has secure OTP generation, expiration, attempt limits, hashing, and verification.
Migration complete
- New sends use Notilify and store the Notilify message ID.
- Delivery events reach your Notilify webhook endpoint.
- Retries use stable idempotency keys.