Skip to main content

Overview

Hypersender sends an SMS webhook to your URL when a message is sent, delivered, fails, or expires, when your phone receives an SMS, and when the phone goes online or offline. You receive it with your own route. The SDK is only needed when you reply. A webhook is a POST with a JSON body and your secret in the Authorization header, so any Node.js framework can handle it. The examples use Express.

Set up the webhook

1

Add the webhook in the dashboard

In the Hypersender dashboard, open your SMS instance, add a webhook with your public HTTPS URL, for example https://example.com/sms/webhook, and pick the events you want.
2

Set a secret

Set an Authorization Secret on the webhook. Hypersender sends it in the Authorization header so you can reject requests that did not come from Hypersender. Save the same value as HYPERSENDER_SMS_WEBHOOK_SECRET.
3

Answer quickly

Reply with a 2xx status right away. If handling an event takes time, store the payload and process it in the background.

Receive and verify webhooks

The secret is sent exactly as you saved it, with no Bearer prefix. Compare it with timingSafeEqual, not ===.

Payload

Every SMS webhook has two keys: event and data. For message events, data is the message:
For phone.* events, data is the phone, with fields such as is_online, last_heartbeat_at, and phone_number. request_id is the value you passed to sendMessage, so you can match a delivery report to your own record. The SMS webhooks reference shows every field and header.

SMS webhook events

Handle each event

Switch on event. This example auto-replies to incoming SMS, tracks delivery, and alerts when the phone goes offline:

Retries and duplicates

If your endpoint does not answer with a 2xx in time, Hypersender retries, so the same event can arrive more than once and out of order.
  • Use event plus data.id (and data.status for message events) as the key to skip duplicates.
  • Compare updated_at before overwriting a newer state.

Next steps

Last modified on November 24, 2026