Webhooks API
API endpoints for managing webhooks in the Kubiya platform
Webhooks API
Webhooks in Kubiya allow you to receive real-time notifications when specific events occur in your workspace. This API enables you to create, manage, and delete webhook endpoints that receive event notifications.
List all webhooks
Create a webhook
List Webhooks
Retrieve all webhooks configured in your workspace.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Get Webhook Details
Retrieve details about a specific webhook.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
webhook_id | string | Yes | ID of the webhook |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
Create Webhook
Create a new webhook endpoint.
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Available Event Types
Event | Description |
---|---|
execution.started | Triggered when a tool execution starts |
execution.completed | Triggered when a tool execution completes |
execution.failed | Triggered when a tool execution fails |
teammate.created | Triggered when a new teammate is created |
teammate.updated | Triggered when a teammate is updated |
teammate.deleted | Triggered when a teammate is deleted |
source.created | Triggered when a new source is created |
source.updated | Triggered when a source is updated |
source.synced | Triggered when a source is synchronized |
tool.created | Triggered when a new tool is created |
tool.updated | Triggered when a tool is updated |
tool.deleted | Triggered when a tool is deleted |
Response
Store the secret value returned when creating a webhook securely. This secret is used to validate that incoming webhook requests are from Kubiya. It will only be shown once when the webhook is created.
Update Webhook
Update an existing webhook.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
webhook_id | string | Yes | ID of the webhook to update |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Body
Response
Delete Webhook
Delete a webhook.
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
webhook_id | string | Yes | ID of the webhook to delete |
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | UserKey YOUR_API_KEY |
Response
A successful delete operation returns an HTTP 200 status with no response body.
Webhook Events
When a subscribed event occurs, Kubiya sends an HTTP POST request to your webhook URL with details about the event.
Request Headers
Name | Description |
---|---|
User-Agent | Kubiya-Webhook/1.0 |
Content-Type | application/json |
X-Kubiya-Event | Type of event (e.g., execution.completed ) |
X-Kubiya-Signature | HMAC signature of the request body using your webhook secret |
X-Kubiya-Timestamp | Unix timestamp when the event was sent |
X-Kubiya-Request-ID | Unique ID for the webhook request |
Request Body Example (execution.completed)
Example Usage
Create a Webhook
Update a Webhook
Delete a Webhook
Verifying Webhook Signatures
To verify that a webhook request is genuinely from Kubiya, you should validate the signature provided in the X-Kubiya-Signature
header. Here's how to do it:
For improved reliability, your webhook endpoint should respond with a 2xx status code quickly (within 5 seconds) to acknowledge receipt of the event. Any processing of the event should be done asynchronously.
Common Errors
HTTP Status | Description |
---|---|
400 | Bad Request - Invalid webhook configuration |
401 | Unauthorized - API key is missing or invalid |
403 | Forbidden - The API key doesn't have permission to manage webhooks |
404 | Not Found - The specified webhook was not found |
409 | Conflict - A webhook with the same URL and events already exists |
500 | Internal Server Error - An unexpected error occurred on the server |
Next Steps
After setting up webhooks, you can:
- Monitor executions through webhook notifications
- React to teammate lifecycle events
- Track changes to tools and sources