Skip to main content
SONZAI
Api

Notifications

List proactive notifications for an agent

GET
/agents/{agentId}/notifications
AuthorizationBearer <token>

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

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Query Parameters

status?string

Filter by status (e.g. pending)

user_id?string

Filter by user ID

limit?integer

Max results (1-500)

Default50
Formatint64
Range1 <= value <= 500

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/notifications"
{
  "$schema": "/api/v1/schemas/ProactiveNotificationsResponse.json",
  "notifications": [
    {
      "agent_id": "string",
      "check_type": "string",
      "consumed_at": "string",
      "created_at": "string",
      "generated_message": "string",
      "intent": "string",
      "message_id": "string",
      "status": "string",
      "user_id": "string",
      "wakeup_id": "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"
}

Get proactive notification history

GET
/agents/{agentId}/notifications/history
AuthorizationBearer <token>

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

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

Query Parameters

limit?integer

Max results (1-500)

Default50
Formatint64
Range1 <= value <= 500

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/notifications/history"
{
  "$schema": "/api/v1/schemas/ProactiveNotificationsResponse.json",
  "notifications": [
    {
      "agent_id": "string",
      "check_type": "string",
      "consumed_at": "string",
      "created_at": "string",
      "generated_message": "string",
      "intent": "string",
      "message_id": "string",
      "status": "string",
      "user_id": "string",
      "wakeup_id": "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"
}

Consume a proactive notification

POST
/agents/{agentId}/notifications/{messageId}/consume
AuthorizationBearer <token>

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

In: header

Path Parameters

agentId*string

Agent UUID or URL-encoded agent name

messageId*string

Proactive message ID to consume

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/agents/string/notifications/string/consume"
{
  "$schema": "/api/v1/schemas/ConsumeNotificationOutputBody.json",
  "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 pending notifications for a project

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

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

In: header

Path Parameters

projectId*string

Project UUID

Query Parameters

agent_id?string

Filter by agent ID

event_type?string

Filter by event type

limit?integer

Max results

Default50
Formatint64
Range1 <= value <= 200

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/notifications"
{
  "$schema": "/api/v1/schemas/ProjectNotificationsListOutputBody.json",
  "count": 0,
  "notifications": [
    {
      "acknowledged_at": "2019-08-24T14:15:22Z",
      "agent_id": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "event_type": "string",
      "expires_at": "2019-08-24T14:15:22Z",
      "notification_id": "string",
      "payload": null,
      "project_id": "string",
      "status": "string",
      "user_id": "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"
}

Acknowledge specific project notifications

POST
/projects/{projectId}/notifications/acknowledge
AuthorizationBearer <token>

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

In: header

Path Parameters

projectId*string

Project UUID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/notifications/acknowledge" \  -H "Content-Type: application/json" \  -d '{    "notification_ids": [      "string"    ]  }'
{
  "$schema": "/api/v1/schemas/AcknowledgeProjectNotificationsOutputBody.json",
  "acknowledged": 0
}
{
  "$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"
}

Acknowledge all pending project notifications

POST
/projects/{projectId}/notifications/acknowledge-all
AuthorizationBearer <token>

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

In: header

Path Parameters

projectId*string

Project UUID

Query Parameters

agent_id?string

Scope to specific agent

event_type?string

Scope to specific event type

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/notifications/acknowledge-all"
{
  "$schema": "/api/v1/schemas/AcknowledgeAllProjectNotificationsOutputBody.json",
  "acknowledged": 0
}
{
  "$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"
}