Skip to main content
SONZAI
Api

Context

Get enriched agent context

GET
/agents/{agentId}/context
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

userId*string

User ID for per-user context scoping

sessionId?string

Session ID for memory caching

instanceId?string

Instance scope

query?string

Current user message for supplementary memory search

language?string

Language code (e.g. en, ja)

timezone?string

IANA timezone (e.g. Asia/Singapore)

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/context?userId=string"
{
  "recent_turns": [
    {
      "content": "string",
      "role": "string",
      "timestamp": "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"
}