How each provider signs SMS webhooks
Each provider proves a webhook came from it in a different way. The tool runs the same checks SMS SDK runs on your server.
| Provider | Header | What is signed | Secret |
|---|---|---|---|
| Twilio | X-Twilio-Signature | Base64 HMAC-SHA1 of the full URL plus every POST parameter, sorted by name. A JSON body is covered by bodySHA256 in the URL instead. | Auth Token |
| Telnyx | telnyx-signature-ed25519, telnyx-timestamp | Ed25519 signature of timestamp|body. | Account public key |
| Plivo | X-Plivo-Signature-V2 (or -Ma-V2), X-Plivo-Signature-V2-Nonce | Base64 HMAC-SHA256 of the URL without its query string, plus the nonce. The body is not covered. | Auth Token (main account's for -Ma-V2) |
| Vonage Messages API | Authorization: Bearer | An HS256 JWT with an iat time and, when present, a payload_hash, the SHA-256 of the body. | Signature secret |
For Bandwidth, SMS SDK checks the Basic auth credentials on your callback. For Sinch, it checks Basic auth or an HMAC secret your Sinch account manager sets up. The tool doesn't cover them, and Webhook security covers them.
Why a webhook signature fails
The URL differs. Twilio and Plivo sign the URL they called. Behind a proxy or load balancer, your app can see http://, another host or another port. Verify against the public URL from the provider console, including Twilio's query string. In SMS SDK, pass it as publicUrl.
The body was parsed first. Telnyx and Vonage sign the exact bytes they sent. If a framework parses JSON and you re-serialize it, spacing and key order can change and the check fails. Read the raw body before anything parses it.
The secret is the wrong one. Twilio signs with the account's primary Auth Token, not an API key secret. Vonage signs with the signature secret from the dashboard, not the API secret. Telnyx needs the public key from the same account that owns the number.
The request is old. SMS SDK rejects a Telnyx timestamp or Vonage iat more than 300 seconds from now, so a captured request can't be replayed later. Turn the age check off above to test a saved request. Twilio and Plivo sign no timestamp, so deduplicate events instead, as Receive webhooks shows.
Verify webhooks in your code
Install SMS SDK with npm install @opencoredev/sms-sdk. Each provider has a parser that verifies the signature, then returns a normalized event, and throws WebhookSignatureError with a reason when the check fails:
import { parseTwilioWebhook, WebhookSignatureError } from "@opencoredev/sms-sdk/webhooks";
export async function POST(request: Request): Promise<Response> {
try {
const event = await parseTwilioWebhook({
request,
credentials: { authToken: process.env.TWILIO_AUTH_TOKEN! },
publicUrl: "https://example.com/webhooks/sms",
});
console.log(event.type, event.dedupeKey);
// Empty TwiML answers both status callbacks and inbound messages without a reply.
return new Response("<Response></Response>", { headers: { "content-type": "text/xml" } });
} catch (error) {
if (error instanceof WebhookSignatureError) {
console.warn("Rejected webhook:", error.reason);
return new Response("Invalid signature", { status: 401 });
}
throw error;
}
}parseTelnyxWebhook(), parsePlivoWebhook() and parseVonageWebhook() work the same way with each provider's credentials. The Twilio, Telnyx, Plivo and Vonage guides show a full route with offline tests, and SMS delivery reports shows what to store from each event.