Create a webhook
Creates a new webhook endpoint. When events occur (e.g. feedback_record.created), the Hub POSTs a signed payload to the webhook URL. If signing_key is omitted, a key is auto-generated (Standard Webhooks format, whsec_...). See WebhookDeliveryPayload for the payload structure sent to your URL.
Body Parameters
URL to receive webhook POSTs. Must be an HTTP or HTTPS URL. NULL bytes not allowed.
Whether the webhook is active (default true)
Optional. If omitted, a key is auto-generated (whsec_...). Used to sign payloads (Standard Webhooks). When provided, max 255 characters; NULL bytes not allowed.
Tenant/organization identifier. NULL bytes not allowed.
Returns
Webhook ID (UUID)
When the webhook was created
Whether the webhook is active
Key used to sign payloads (Standard Webhooks)
When the webhook was last updated
URL that receives webhook POSTs
Read-only. When the webhook was disabled. Omitted when null. Cleared when the webhook is re-enabled via PATCH.
Read-only. Set by the system when the webhook was disabled (e.g. after 410 Gone or max delivery failures). Omitted when null.
Tenant/organization identifier
Create a webhook
curl http://localhost:8080/v1/webhooks \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $HUB_API_KEY" \
-d '{
"url": "https://example.com/hub-events",
"signing_key": "whsec_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"tenant_id": "org-123"
}'{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"enabled": true,
"signing_key": "signing_key",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url",
"disabled_at": "2019-12-27T18:11:19.117Z",
"disabled_reason": "disabled_reason",
"event_types": [
"feedback_record.created"
],
"tenant_id": "tenant_id"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"enabled": true,
"signing_key": "signing_key",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url",
"disabled_at": "2019-12-27T18:11:19.117Z",
"disabled_reason": "disabled_reason",
"event_types": [
"feedback_record.created"
],
"tenant_id": "tenant_id"
}