Skip to main content
SONZAI
Api

Webhooks

List webhooks for a project

GET
/projects/{projectId}/webhooks
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

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

DELETE
/projects/{projectId}/webhooks/{eventType}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

eventType*string

Webhook event type to delete

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/projects/string/webhooks/string"
Empty
{
  "$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

PUT
/projects/{projectId}/webhooks/{eventType}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

eventType*string

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

GET
/projects/{projectId}/webhooks/{eventType}/attempts
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

eventType*string

Webhook event type

Query Parameters

limit?integer

Max results

Default50
Formatint64
Range1 <= value <= 500
offset?integer

Pagination offset

Default0
Formatint64
Range0 <= value

Response 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

POST
/projects/{projectId}/webhooks/{eventType}/rotate-secret
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

eventType*string

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

GET
/webhooks
AuthorizationBearer <token>

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)

DELETE
/webhooks/{eventType}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

eventType*string

Webhook event type to delete

Response Body

application/problem+json

curl -X DELETE "https://loading/api/v1/webhooks/string"
Empty
{
  "$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)

PUT
/webhooks/{eventType}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

eventType*string

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)

GET
/webhooks/{eventType}/attempts
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

eventType*string

Webhook event type

Query Parameters

limit?integer

Max results

Default50
Formatint64
Range1 <= value <= 500
offset?integer

Pagination offset

Default0
Formatint64
Range0 <= value

Response 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)

POST
/webhooks/{eventType}/rotate-secret
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

eventType*string

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"
}