Skip to main content

End-to-End Webhook Guide

1. Register your endpoint

curl -X POST https://api.notifo.cloud/v1/webhooks \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/hooks/notifo",
"events": ["message.delivered", "message.failed"]
}'

Save the secret from the response.

2. Set up your endpoint

Your server must:

  1. Accept POST requests
  2. Read the raw body bytes (do not parse JSON first)
  3. Verify the X-Notifo-Signature header
  4. Return 2xx within 10 seconds

See Signature Verification → for language examples.

3. Test locally with a tunnel

Use ngrok or cloudflared to expose your local server:

ngrok http 3000
# Forwarding: https://abc123.ngrok.io -> localhost:3000

Register https://abc123.ngrok.io/hooks/notifo as your webhook URL.

4. Trigger a test

Send a message via the API and watch your endpoint receive the message.queuedmessage.delivered sequence.

5. Handle the payload

const event = JSON.parse(rawBody);

switch (event.event) {
case 'message.delivered':
await markDelivered(event.messageId);
break;
case 'message.failed':
await alertTeam(event.messageId, event.error);
break;
}