Set up an endpoint
1
Add your URL
In the dashboard, open Settings → Webhooks and add your HTTPS URL.
2
Pick events
Choose the events you want, or all of them.
3
Copy the signing secret
It starts with
whsec_ and is shown once. Keep it on your server.4
Test it
Select Test next to the endpoint to receive a signed
ping event.What Messaly sends
APOST with a JSON body. Every event has the same envelope; data depends on the event.
Events
sms.delivered
sms.delivered
The network confirms an SMS reached the phone.
sms.failed
sms.failed
The network reports an SMS couldn’t be delivered. Its charge is refunded to your wallet.
sms.inbound
sms.inbound
Someone texts your shortcode or number (anything other than STOP/START).
sms.opt_out
sms.opt_out
Someone replies STOP (or UNSUBSCRIBE, and so on). They’re left out of your future sends automatically.
campaign.completed
campaign.completed
An SMS or WhatsApp campaign finishes sending.
wallet.topup
wallet.topup
A wallet top-up is paid and credited.
whatsapp.inbound
whatsapp.inbound
A customer messages your WhatsApp number.
whatsapp.status
whatsapp.status
A WhatsApp message you sent is
sent, delivered, read or failed.Verify the signature
X-Telaven-Signature is t=<unix seconds>,v1=<hex>, where v1 = HMAC-SHA256(secret, t + "." + rawBody).
Compute it over the raw request body, before any JSON parsing. Compare in constant time, and reject anything older than 5 minutes.
Retries
- Reply with any 2xx within 10 seconds. Anything else, including a redirect, counts as a failure.
- A failed delivery is tried up to 6 times in total, waiting about 10s, 20s, 40s, 80s and 160s between attempts.
- Retries keep the same
idandX-Telaven-Delivery, so you can ignore duplicates.