API Documentation
Dashboard

Webhooks

Configure webhooks to receive real-time notifications when events occur.

GET/api/v1/workspaces/{workspace_id}/webhooks

List Webhooks

Get all webhooks configured for the workspace.

Path Parameters

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace 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 webhooks
json
[
  {
    "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}/webhooks

Create Webhook

Register a new webhook endpoint. Supported events: job.completed, job.failed, alert.triggered.

Path Parameters

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace ID

Request Body

NameTypeRequiredDescription
urlstringRequiredWebhook endpoint URL
eventsstring[]Default: ["job.completed"]Events to subscribe to
secretstringOptionalSigning 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 created
json
{
  "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

NameTypeRequiredDescription
workspace_iduuidRequiredWorkspace ID
webhook_iduuidRequiredWebhook 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 deleted
json
{
  "message": "Webhook deleted successfully"
}