Skip to main content
Hany fires delivery status webhook events as your SMS messages move through the carrier network. When a carrier confirms delivery — or reports a failure — Hany immediately POSTs the event to the callback_url you provided in your original send request. Use these events to update your records, notify your users, or trigger follow-up workflows in real time.

Event Types

  • sms.delivered — Fired when the carrier confirms the message was successfully delivered to the recipient’s handset.
  • sms.failed — Fired when delivery fails after all carrier-level retries are exhausted. The payload includes an error_code and error_message to help you diagnose the cause.
  • sms.sent — Fired when the message leaves Hany’s gateway and is handed off to the carrier network. At this point, delivery is not yet confirmed.

Payload Examples

The examples below show the payload shapes for each event type. Successful delivery (sms.delivered)
Message dispatched to carrier (sms.sent)

Payload Fields

string
required
The type of webhook event. One of sms.delivered, sms.failed, or sms.sent.
string
required
The unique identifier of the SMS message. Use this to correlate the webhook event with the original send request.
string | null
required
The batch ID if the message was sent via the bulk send endpoint. null for single sends.
string
required
The recipient’s phone number in E.164 format.
string
required
The sender ID used when the message was sent — either a phone number or an alphanumeric brand name.
string
required
The delivery status of the message. One of delivered, failed, or sent.
string | null
required
ISO 8601 timestamp indicating when the carrier confirmed delivery. null if the message has not been delivered (for example, on sms.sent or sms.failed events).
string
required
ISO 8601 timestamp indicating when the message was dispatched from Hany’s gateway to the carrier.
string
required
ISO 8601 timestamp indicating when this webhook event was generated and fired by Hany.

Failure Payload Example

When delivery fails, Hany includes additional error_code and error_message fields to help you understand and respond to the failure:
string
A machine-readable code describing the reason for failure (for example, unreachable_subscriber). Present only on sms.failed events.
string
A human-readable description of the failure reason. Present only on sms.failed events.

Handling the Webhook in Your Server

The example below shows a minimal Node.js Express handler that receives delivery status events and acknowledges them correctly:
server.js
Always return HTTP 200 immediately and process the event asynchronously. If your handler takes longer than 5 seconds to respond, Hany treats the delivery as failed and begins the retry sequence.
The batch_id field lets you correlate individual delivery events back to a bulk campaign. When you send messages via the bulk endpoint, every resulting webhook event for that campaign will carry the same batch_id, making it easy to track per-recipient outcomes at scale.