Skip to main content
SONZAI
Api

Mood

Get agent mood state

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

user_id?string

Optional user ID to get per-user mood

instance_id?string

Optional instance ID (scoped with user_id)

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/mood"
{
  "$schema": "/api/v1/schemas/MoodResponse.json",
  "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
  }
}
{
  "$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 agent mood history

GET
/agents/{agentId}/mood-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 entries to return (1-500)

Default50
Formatint64
user_id?string

Optional user ID to filter history

instance_id?string

Optional instance ID (scoped with user_id)

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/mood-history"
{
  "$schema": "/api/v1/schemas/MoodHistoryResponse.json",
  "entries": [
    {
      "affiliation": 0.1,
      "arousal": 0.1,
      "delta_affiliation": 0.1,
      "delta_arousal": 0.1,
      "delta_tension": 0.1,
      "delta_valence": 0.1,
      "label": "string",
      "tension": 0.1,
      "timestamp": "string",
      "trigger_reason": "string",
      "trigger_type": "string",
      "valence": 0.1
    }
  ]
}
{
  "$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 aggregated mood across users

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

days?integer

Number of days to aggregate over

Default5
Formatint64

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/agents/string/mood/aggregate"
{
  "$schema": "/api/v1/schemas/MoodAggregateResponse.json",
  "affiliation": 0.1,
  "arousal": 0.1,
  "days_window": 0,
  "label": "string",
  "tension": 0.1,
  "user_count": 0,
  "valence": 0.1
}
{
  "$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"
}