Skip to main content
Api

Users

List users for an agent

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

page_size?integer

Items per page (default 100, max 500)

Formatint64
Rangevalue <= 500
cursor?string

Pagination cursor (base64). Pages are ordered by user_id ASC for O(1) traversal.

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/users"
{
  "$schema": "/api/v1/schemas/UsersResponse.json",
  "has_more": true,
  "next_cursor": "string",
  "users": [
    {
      "created_at": "string",
      "display_name": "string",
      "last_interaction_at": "string",
      "metadata": {
        "custom": {
          "property1": "string",
          "property2": "string"
        },
        "email": "string",
        "phone": "string"
      },
      "mood": {
        "affiliation": 0.1,
        "agent_id": "string",
        "arousal": 0.1,
        "baseline_affiliation": 0.1,
        "baseline_arousal": 0.1,
        "baseline_tension": 0.1,
        "baseline_valence": 0.1,
        "created_at": "2019-08-24T14:15:22Z",
        "label": "string",
        "last_decay_at": "2019-08-24T14:15:22Z",
        "last_interaction_at": "2019-08-24T14:15:22Z",
        "tension": 0.1,
        "updated_at": "2019-08-24T14:15:22Z",
        "user_id": "string",
        "valence": 0.1
      },
      "role": "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"
}

Get current user with organizations

GET
/me

Authorization

bearerClerk
AuthorizationBearer <token>

Clerk session JWT from an authenticated dashboard user. Format: Bearer eyJ....

In: header

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/me"
{
  "$schema": "/api/v1/schemas/MeResponse.json",
  "email": "string",
  "orgs": [
    {
      "created_at": "string",
      "id": "string",
      "member_count": 0,
      "name": "string",
      "role": "string",
      "slug": "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"
}