Webhooks
Configure webhooks to receive real-time notifications when events occur.
GET
/api/v1/workspaces/{workspace_id}/webhooksList Webhooks
Get all webhooks configured for the workspace.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
Code Examples
bash
curl https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/webhooks \
-H "X-API-Key: rp_your_api_key"Response
200List of webhooksjson
[
{
"id": "wh_550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/webhook",
"events": [
"job.completed"
],
"is_active": true,
"last_triggered_at": "2026-03-20T10:00:00Z",
"failure_count": 0,
"created_at": "2026-02-15T09:00:00Z"
}
]POST
/api/v1/workspaces/{workspace_id}/webhooksCreate Webhook
Register a new webhook endpoint. Supported events: job.completed, job.failed, alert.triggered.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Webhook endpoint URL |
| events | string[] | Default: ["job.completed"] | Events to subscribe to |
| secret | string | Optional | Signing secret for payload verification |
json
{
"url": "https://example.com/webhook",
"events": [
"job.completed",
"alert.triggered"
],
"secret": "my_webhook_secret"
}Code Examples
bash
curl -X POST https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/webhooks \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhook",
"events": ["job.completed", "alert.triggered"],
"secret": "my_webhook_secret"
}'Response
201Webhook createdjson
{
"id": "wh_661e9400-f39c-52e5-b827-557766551111",
"url": "https://example.com/webhook",
"events": [
"job.completed",
"alert.triggered"
],
"is_active": true,
"last_triggered_at": null,
"failure_count": 0,
"created_at": "2026-03-20T14:00:00Z"
}DELETE
/api/v1/workspaces/{workspace_id}/webhooks/{webhook_id}Delete Webhook
Remove a webhook endpoint.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_id | uuid | Required | Workspace ID |
| webhook_id | uuid | Required | Webhook ID |
Code Examples
bash
curl -X DELETE https://api.sentrasa.com/api/v1/workspaces/{workspace_id}/webhooks/{webhook_id} \
-H "X-API-Key: rp_your_api_key"Response
200Webhook deletedjson
{
"message": "Webhook deleted successfully"
}