Webhooks
Webhooks are real-time HTTP notifications sent to your server when events happen in Orki. Instead of polling for changes, your system receives instant updates whenever a message arrives, a chat status changes, or other events occur.
Path: Settings > Webhooks
Registering a Webhook
- Go to Settings > Webhooks
- Click "Add Webhook"
- Enter your webhook URL (must be HTTPS)
- Enter a verify token (a secret string used for the verification handshake)
- Select the event types you want to subscribe to
Event Types
| Event | Description |
|---|---|
meta.message | A message was received from WhatsApp/Instagram |
message.created | A new message was created (inbound or outbound) |
chat.status_changed | A chat's status changed (active, snoozed, closed, needs attention) |
Verification Handshake
When you register a webhook, Orki sends a GET request to your URL to verify ownership:
- Orki sends a GET request with a
hub.challengeparameter and your verify token - Your server validates the verify token matches what you configured
- Your server responds with the
hub.challengevalue in the response body
This confirms that you own the endpoint and are ready to receive events.
HMAC-SHA256 Signature Verification
Every webhook payload includes an X-Hub-Signature-256 header containing sha256=<hex_digest> of the request body, using your verify token as the HMAC key.
Always verify signatures to ensure payloads are genuinely from Orki.
Example (Node.js)
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
Use timingSafeEqual (or equivalent in your language) to prevent timing attacks when comparing signatures.
Delivery Logs
View the delivery history for each webhook to monitor and debug your integration.
What You Can See
- Event type — which event triggered the delivery
- Response status code — what your server responded with
- Response time — how long your server took to respond
- Timestamp — when the delivery was attempted
- Error details — shown for failed deliveries
Filtering
Filter delivery logs by:
- Event type
- Success or failure
- Date range
Retry Behavior
Failed deliveries are automatically retried. Orki tracks the failure count for each webhook — webhooks with too many consecutive failures display a warning in the dashboard.
Test Events
Before going live, use the test event feature to verify your endpoint is working correctly. This sends a sample payload to your webhook URL so you can confirm everything is wired up properly.
Make sure your endpoint responds with a 2xx status code within 5 seconds, or the delivery will be marked as failed.
Use the delivery logs to debug integration issues — they show exactly what was sent and what your server responded.
Next Steps
- Service Account Tokens — Create programmatic API access for external systems
- Security — Manage your account security settings