Webhooks API
Create webhook subscriptions, verify deliveries, inspect delivery history, rotate secrets, and manage status.
Webhooks API
Webhooks let external systems react to RogerIQ events.
txt/api/v1/projects/:projectId/webhooks
Create Webhook
bashcurl https://api.rogeriq.com/api/v1/projects/prj_123/webhooks \ -H "Authorization: Bearer riq_your_key" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/rogeriq", "events": ["conversation.created", "message.created"] }'
The secret is returned only on creation. Store it immediately.
List Webhooks
bashcurl https://api.rogeriq.com/api/v1/projects/prj_123/webhooks \ -H "Authorization: Bearer riq_your_key"
Update Webhook
bashcurl -X PATCH https://api.rogeriq.com/api/v1/projects/prj_123/webhooks/whk_123 \ -H "Authorization: Bearer riq_your_key" \ -H "Content-Type: application/json" \ -d '{ "events": ["*"], "status": "active" }'
Delivery History
bashcurl https://api.rogeriq.com/api/v1/projects/prj_123/webhooks/whk_123/deliveries \ -H "Authorization: Bearer riq_your_key"
Rotate Secret
bashcurl -X POST https://api.rogeriq.com/api/v1/projects/prj_123/webhooks/whk_123/rotate-secret \ -H "Authorization: Bearer riq_your_key"
Verify Signatures
RogerIQ signs webhook payloads with the webhook secret. Verify signatures before trusting the payload.
tsimport crypto from "node:crypto";function verify(secret: string, body: string, signature: string) { const expected = crypto .createHmac("sha256", secret) .update(body) .digest("hex"); return crypto.timingSafeEqual( Buffer.from(expected), Buffer.from(signature) );}
Rotate a webhook secret if it is logged, pasted into a client, or shared with a system that should no longer receive events.