Skip to main content
Webhooks let Sahut send real-time HTTP POST notifications to your server when events occur — such as a new message arriving or a conversation being resolved. Use webhooks to trigger actions in your systems without polling the API.

How webhooks work

  1. You create a webhook endpoint on your server (a URL that accepts POST requests)
  2. You register that URL in Sahut
  3. When an event occurs, Sahut sends a POST request with a JSON payload to your URL
  4. Your server responds with 200 OK within 10 seconds
If your server doesn’t respond with 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

  1. Go to Settings → Integrations → Webhooks
  2. Click Tambah Webhook (Add Webhook)
  3. Enter your Endpoint URL
  4. Select the Events you want to receive
  5. 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

Copy the secret value from the creation response. Sahut only shows it once. You use this secret to verify webhook signatures.

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 a X-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.