How webhooks work
- You create a webhook endpoint on your server (a URL that accepts POST requests)
- You register that URL in Sahut
- When an event occurs, Sahut sends a POST request with a JSON payload to your URL
- Your server responds with
200 OKwithin 10 seconds
2xx within 10 seconds, Sahut retries delivery up to 5 times with exponential backoff (5s, 30s, 2m, 10m, 30m).
Registering a webhook
Via the dashboard
- Go to Settings → Integrations → Webhooks
- Click Tambah Webhook (Add Webhook)
- Enter your Endpoint URL
- Select the Events you want to receive
- Click Simpan (Save)
Via the API
Request body
string
required
The HTTPS URL to receive webhook events.
array
required
List of event types to subscribe to. See event types below.
Example request
Example response
Delete a webhook
string
required
Webhook ID to delete.
Event types
Webhook payload format
All webhook events share the same envelope structure:Example: message.created payload
Verifying webhook signatures
Sahut signs every webhook request so you can verify it came from Sahut and wasn’t tampered with. Each request includes aX-Sahut-Signature header containing an HMAC-SHA256 signature of the raw request body, signed with your webhook’s secret.
To verify the signature:
Always verify webhook signatures in production to protect against spoofed requests.