Webhooks
List webhooks for a project
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Project UUID
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/projects/string/webhooks"{
"$schema": "/api/v1/schemas/ListWebhooksOutputBody.json",
"webhooks": [
{
"auth_header": "string",
"created_at": "2019-08-24T14:15:22Z",
"event_type": "string",
"is_active": true,
"project_id": "string",
"updated_at": "2019-08-24T14:15:22Z",
"webhook_url": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Delete a webhook
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Project UUID
Webhook event type to delete
Response Body
application/problem+json
curl -X DELETE "https://loading/api/v1/projects/string/webhooks/string"{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Register or update a webhook
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Project UUID
Webhook event type (e.g. session.end, memory.created)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X PUT "https://loading/api/v1/projects/string/webhooks/string" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "string" }'{
"$schema": "/api/v1/schemas/UpsertWebhookOutputBody.json",
"signing_secret": "string",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List webhook delivery attempts
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Project UUID
Webhook event type
Query Parameters
Max results
50int641 <= value <= 500Pagination offset
0int640 <= valueResponse Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/projects/string/webhooks/string/attempts"{
"$schema": "/api/v1/schemas/ListDeliveryAttemptsOutputBody.json",
"attempts": [
{
"attempt_id": "string",
"attempt_number": 0,
"created_at": "2019-08-24T14:15:22Z",
"duration_ms": 0,
"error_message": "string",
"event_type": "string",
"project_id": "string",
"request_body": "string",
"response_body": "string",
"response_code": 0,
"status": "string",
"webhook_url": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Rotate webhook signing secret
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Project UUID
Webhook event type whose secret to rotate
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/projects/string/webhooks/string/rotate-secret"{
"$schema": "/api/v1/schemas/RotateSigningSecretOutputBody.json",
"signing_secret": "string",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List webhooks for current tenant
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/webhooks"{
"$schema": "/api/v1/schemas/ListWebhooksOutputBody.json",
"webhooks": [
{
"auth_header": "string",
"created_at": "2019-08-24T14:15:22Z",
"event_type": "string",
"is_active": true,
"project_id": "string",
"updated_at": "2019-08-24T14:15:22Z",
"webhook_url": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Delete a webhook (tenant-scoped)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Webhook event type to delete
Response Body
application/problem+json
curl -X DELETE "https://loading/api/v1/webhooks/string"{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Register or update a webhook (tenant-scoped)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Webhook event type (e.g. session.end, memory.created)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X PUT "https://loading/api/v1/webhooks/string" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "string" }'{
"$schema": "/api/v1/schemas/UpsertWebhookOutputBody.json",
"signing_secret": "string",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List webhook delivery attempts (tenant-scoped)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Webhook event type
Query Parameters
Max results
50int641 <= value <= 500Pagination offset
0int640 <= valueResponse Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/webhooks/string/attempts"{
"$schema": "/api/v1/schemas/ListDeliveryAttemptsOutputBody.json",
"attempts": [
{
"attempt_id": "string",
"attempt_number": 0,
"created_at": "2019-08-24T14:15:22Z",
"duration_ms": 0,
"error_message": "string",
"event_type": "string",
"project_id": "string",
"request_body": "string",
"response_body": "string",
"response_code": 0,
"status": "string",
"webhook_url": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Rotate webhook signing secret (tenant-scoped)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Webhook event type whose secret to rotate
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/webhooks/string/rotate-secret"{
"$schema": "/api/v1/schemas/RotateSigningSecretOutputBody.json",
"signing_secret": "string",
"success": true
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}