Setting Up Webhooks
Webhooks
Webhooks send real-time HTTP POST notifications to your server when events occur in Onbrix.
Setting Up a Webhook
Available Events
record.created — A new record is createdrecord.updated — A record is modifiedrecord.deleted — A record is deletedPayload Format
Webhooks send a JSON payload:
{
"event": "record.created",
"module": "contacts",
"record": {
"id": "abc-123",
"data": {
"first_name": "Jane",
"email": "jane@example.com"
}
},
"timestamp": "2024-01-15T10:30:00Z"
}
Signature Verification
Every webhook includes an HMAC-SHA256 signature in the X-Webhook-Signature header. Verify it to ensure the webhook is from Onbrix:
const crypto = require("crypto");
const signature = crypto
.createHmac("sha256", webhookSecret)
.update(requestBody)
.digest("hex");
const isValid = signature === receivedSignature;
Retry Policy
If your endpoint returns a non-2xx status code, Onbrix retries with exponential backoff:
After 3 failed attempts, the delivery is marked as failed. You can view delivery history in the webhook settings.