# Webhooks

Configure webhook subscriptions

## GET /webhooks

> List webhooks

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"schemas":{"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secret":{"type":"string","description":"HMAC signing secret for payload verification"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"active":{"type":"boolean"},"organization_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WebhookEvent":{"type":"string","enum":["call.started","call.completed","call.failed","call.recording.ready","transcription.completed","number.provisioned","number.released"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"},"details":{"type":"object","additionalProperties":true,"description":"Additional error details"}}}},"responses":{"Unauthorized":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhooks","operationId":"listWebhooks","parameters":[{"$ref":"#/components/parameters/OrganizationId"}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## Create webhook

> Creates a new webhook subscription. A signing secret is auto-generated\
> for payload verification.<br>

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"schemas":{"WebhookCreate":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"},"minItems":1},"active":{"type":"boolean","default":true}}},"WebhookEvent":{"type":"string","enum":["call.started","call.completed","call.failed","call.recording.ready","transcription.completed","number.provisioned","number.released"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secret":{"type":"string","description":"HMAC signing secret for payload verification"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"active":{"type":"boolean"},"organization_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"},"details":{"type":"object","additionalProperties":true,"description":"Additional error details"}}}},"responses":{"BadRequest":{"description":"Bad request - Invalid parameters or request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/webhooks":{"post":{"tags":["Webhooks"],"summary":"Create webhook","description":"Creates a new webhook subscription. A signing secret is auto-generated\nfor payload verification.\n","operationId":"createWebhook","parameters":[{"$ref":"#/components/parameters/OrganizationId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```

## GET /webhooks/{id}

> Get webhook details

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"WebhookId":{"name":"id","in":"path","required":true,"description":"Webhook UUID","schema":{"type":"string","format":"uuid"}},"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"schemas":{"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secret":{"type":"string","description":"HMAC signing secret for payload verification"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"active":{"type":"boolean"},"organization_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WebhookEvent":{"type":"string","enum":["call.started","call.completed","call.failed","call.recording.ready","transcription.completed","number.provisioned","number.released"]},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"},"details":{"type":"object","additionalProperties":true,"description":"Additional error details"}}}},"responses":{"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook details","operationId":"getWebhook","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/OrganizationId"}],"responses":{"200":{"description":"Webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## DELETE /webhooks/{id}

> Delete webhook

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"WebhookId":{"name":"id","in":"path","required":true,"description":"Webhook UUID","schema":{"type":"string","format":"uuid"}},"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"responses":{"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"},"details":{"type":"object","additionalProperties":true,"description":"Additional error details"}}}}},"paths":{"/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Delete webhook","operationId":"deleteWebhook","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/OrganizationId"}],"responses":{"204":{"description":"Webhook deleted"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## PATCH /webhooks/{id}

> Update webhook

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"WebhookId":{"name":"id","in":"path","required":true,"description":"Webhook UUID","schema":{"type":"string","format":"uuid"}},"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"schemas":{"WebhookEvent":{"type":"string","enum":["call.started","call.completed","call.failed","call.recording.ready","transcription.completed","number.provisioned","number.released"]},"Webhook":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"secret":{"type":"string","description":"HMAC signing secret for payload verification"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"active":{"type":"boolean"},"organization_id":{"type":"string","format":"uuid"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message"},"code":{"type":"string","description":"Machine-readable error code"},"details":{"type":"object","additionalProperties":true,"description":"Additional error details"}}}},"responses":{"BadRequest":{"description":"Bad request - Invalid parameters or request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/webhooks/{id}":{"patch":{"tags":["Webhooks"],"summary":"Update webhook","operationId":"updateWebhook","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/OrganizationId"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Webhook updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
```

## Test webhook

> Sends a test payload to the webhook endpoint

```json
{"openapi":"3.0.3","info":{"title":"KrosAI Cockpit API","version":"1.3.0"},"tags":[{"name":"Webhooks","description":"Configure webhook subscriptions"}],"servers":[{"url":"https://api.krosai.com/v1","description":"Production API"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key in format `kros_live_xxxx` for production or `kros_test_xxxx` for testing.\nAlso accepts JWT tokens from Supabase Auth for dashboard sessions.\n\n**Alternative:** You can also use the `x-api-key` header instead of Authorization Bearer.\n"}},"parameters":{"WebhookId":{"name":"id","in":"path","required":true,"description":"Webhook UUID","schema":{"type":"string","format":"uuid"}},"OrganizationId":{"name":"x-organization-id","in":"header","required":false,"description":"Organization UUID for multi-tenant context. Falls back to user's first organization if not provided.","schema":{"type":"string","format":"uuid"}}},"schemas":{"WebhookTestResult":{"type":"object","properties":{"success":{"type":"boolean"},"status_code":{"type":"integer","nullable":true},"message":{"type":"string"}}}}},"paths":{"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Test webhook","description":"Sends a test payload to the webhook endpoint","operationId":"testWebhook","parameters":[{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/OrganizationId"}],"responses":{"200":{"description":"Test result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResult"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.krosai.com/api-reference/reference/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
