Webhook Subscriptions
This section contains 1 subgroups.
Endpoints for managing webhook subscriptions. These APIs allow you to set up, view, update, and delete subscriptions to receive webhook notifications for various system events.
List Webhook Subscriptions
/webhooks/subscriptionsGet a paginated list of webhook subscriptions for the current tenant. Requires view:tenant permission.
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Page number for pagination Example: |
limit | string | Number of items per page Example: |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/webhooks/subscriptions?page=1&limit=10&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscriptions retrieved successfully",4 "subscriptions": [5 {6 "id": "uuid",7 "module_id": "DELIVERY",8 "webhook_url": "https://example.com/webhook",9 "secret_header_key": "X-Webhook-Secret",10 "is_active": true,11 "created_at": "2023-08-01T10:00:00Z",12 "updated_at": "2023-08-01T10:00:00Z"13 }14 ],15 "page": 1,16 "limit": 10,17 "total": 118}List User Webhook Subscriptions
/webhooks/users/:user_id/subscriptionsGet a paginated list of webhook subscriptions for a specific user. Requires view:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
user_idRequired | string | ID of the user to list webhook subscriptions for Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
page | string | Page number for pagination Example: |
limit | string | Number of items per page Example: |
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/webhooks/users/${USER_ID}/subscriptions?page=1&limit=10&language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscriptions retrieved successfully",4 "subscriptions": [5 {6 "id": "uuid",7 "module_id": "DELIVERY",8 "webhook_url": "https://example.com/webhook",9 "secret_header_key": "X-Webhook-Secret",10 "is_active": true,11 "user_id": "uuid",12 "created_at": "2023-08-01T10:00:00Z",13 "updated_at": "2023-08-01T10:00:00Z"14 }15 ],16 "page": 1,17 "limit": 10,18 "total": 1,19 "user_id": "uuid"20}Create Webhook Subscription
/webhooks/subscriptionsCreate a new webhook subscription for the current tenant. Requires manage:webhooks:tenant permission.
Required Fields
module_id: Identifier for the module generating events (e.g., 'DELIVERY')webhook_url: HTTPS URL to receive webhook events
Optional Fields
secret_header_key: Name of header to include webhook secret insecret_header_value: Secret value for webhook authenticationis_active: Whether the subscription is active. An explicitfalseis preserved; when omitted, it defaults totrue.
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
module_id | string | — |
webhook_url | string | — |
secret_header_key | string | — |
secret_header_value | string | — |
is_active | boolean | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/webhooks/subscriptions?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "module_id": "DELIVERY",6 "webhook_url": "https://example.com/webhook",7 "secret_header_key": "X-Webhook-Secret",8 "secret_header_value": "your-secret-key-here",9 "is_active": false10}'Response examples
1{2 "success": true,3 "message": "Webhook subscription created successfully",4 "subscription": {5 "id": "uuid",6 "tenant_id": "uuid",7 "module_id": "DELIVERY",8 "webhook_url": "https://example.com/webhook",9 "secret_header_key": "X-Webhook-Secret",10 "is_active": false,11 "created_at": "2023-08-01T10:00:00Z",12 "updated_at": "2023-08-01T10:00:00Z"13 }14}Get Webhook Subscription
/webhooks/subscriptions/:subscriptionIdGet details of a specific webhook subscription by ID. Requires view:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
subscriptionIdRequired | string | ID of the webhook subscription to retrieve Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/webhooks/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscription retrieved successfully",4 "subscription": {5 "id": "uuid",6 "module_id": "DELIVERY",7 "webhook_url": "https://example.com/webhook",8 "secret_header_key": "X-Webhook-Secret",9 "is_active": true,10 "created_at": "2023-08-01T10:00:00Z",11 "updated_at": "2023-08-01T10:00:00Z"12 }13}Get User Webhook Subscription
/webhooks/users/:user_id/subscriptions/:subscriptionIdGet details of a specific webhook subscription by ID for a specific user. Requires view:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
user_idRequired | string | ID of the user Example: |
subscriptionIdRequired | string | ID of the webhook subscription to retrieve Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/webhooks/users/${USER_ID}/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscription retrieved successfully",4 "subscription": {5 "id": "uuid",6 "module_id": "DELIVERY",7 "webhook_url": "https://example.com/webhook",8 "secret_header_key": "X-Webhook-Secret",9 "is_active": true,10 "user_id": "uuid",11 "created_at": "2023-08-01T10:00:00Z",12 "updated_at": "2023-08-01T10:00:00Z"13 },14 "user_id": "uuid"15}Update Webhook Subscription
/webhooks/subscriptions/:subscriptionIdPartially updates the tenant-owned webhook subscription identified by subscriptionId. Requires manage:webhooks:tenant permission. module_id is not required and is not updated. Send only is_active: true to activate and is_active: false to deactivate. Updating webhook_url performs the existing reachability test before saving.
Updatable Fields
webhook_url: HTTPS URL to receive webhook eventssecret_header_key: Name of the webhook authentication headersecret_header_value: Value of the webhook authentication headeris_active: Boolean active stateuser_id: Optional business-user scope
Frontend contract
Use the subscription id from GET /webhooks/subscriptions as subscriptionId. Show an Activate action when is_active is false and a Deactivate action when it is true. Submit an is_active-only body, disable the action while pending, and replace the row with the returned subscription after HTTP 200. A module-only list entry without an id is not an existing subscription and cannot be activated. Important errors: 400 for invalid input or a rejected updated URL, 404 when the tenant-owned subscription is not found, and 500 for an unexpected update failure.
Path parameters
| Parameter | Type | Description |
|---|---|---|
subscriptionIdRequired | string | ID of the webhook subscription to update Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/webhooks/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "is_active": true6}'Response examples
1{2 "success": true,3 "message": "Webhook Subscription Updated Successfully",4 "subscription": {5 "id": "uuid",6 "module_id": "DELIVERY",7 "webhook_url": "https://example.com/webhook",8 "secret_header_key": "X-Webhook-Secret",9 "is_active": true,10 "user_id": null,11 "created_at": "2023-08-01T10:00:00Z",12 "updated_at": "2023-08-01T11:00:00Z"13 }14}Update User Webhook Subscription
/webhooks/users/:user_id/subscriptions/:subscriptionIdPartially updates an existing webhook subscription for the business user identified in the path. Requires manage:webhooks:tenant permission. module_id is not required and is not updated. Send only is_active: true to activate and is_active: false to deactivate.
Updatable Fields
webhook_url: HTTPS URL to receive webhook eventssecret_header_key: Name of the webhook authentication headersecret_header_value: Value of the webhook authentication headeris_active: Boolean active state
Path parameters
| Parameter | Type | Description |
|---|---|---|
user_idRequired | string | ID of the user Example: |
subscriptionIdRequired | string | ID of the webhook subscription to update Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | — |
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/webhooks/users/${USER_ID}/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "is_active": true6}'Response examples
1{2 "success": true,3 "message": "Webhook Subscription Updated Successfully",4 "subscription": {5 "id": "uuid",6 "module_id": "DELIVERY",7 "webhook_url": "https://example.com/webhook",8 "secret_header_key": "X-Webhook-Secret",9 "is_active": true,10 "user_id": "uuid",11 "created_at": "2023-08-01T10:00:00Z",12 "updated_at": "2023-08-01T11:00:00Z"13 }14}Delete Webhook Subscription
/webhooks/subscriptions/:subscriptionIdDelete a webhook subscription by ID. Requires manage:webhooks:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
subscriptionIdRequired | string | ID of the webhook subscription to delete Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/webhooks/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscription deleted successfully"4}Delete User Webhook Subscription
/webhooks/users/:user_id/subscriptions/:subscriptionIdDelete a webhook subscription by ID for a specific user. Requires manage:webhooks:tenant permission.
Path parameters
| Parameter | Type | Description |
|---|---|---|
user_idRequired | string | ID of the user Example: |
subscriptionIdRequired | string | ID of the webhook subscription to delete Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
language | string | Preferred language for response messages Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/webhooks/users/${USER_ID}/subscriptions/${SUBSCRIPTIONID}?language=en" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"Response examples
1{2 "success": true,3 "message": "Webhook subscription deleted successfully"4}