PUT /api/v1/memory/agents/:agent_id/mood
Auth: Memory API token (Authorization: Bearer trm_api_… or trm_mk_…) minted with writes_enabled=true, or the agent owner's/admin's JWT. A recall-only credential gets 403 writes are off for this credential.
PUT
/api/v1/memory/agents/:agent_id/moodstableSet the agent's mood
| Name | In | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|---|
agent_id | query | string | required | — | — | The agent's agent_key (path segment). |
mood | body | — | optional | — | — | Object with valence (clamped -1.0–1.0, default 0.0), arousal and dominance (clamped 0–1, default 0.5). |
hormones | body | — | optional | — | — | Object with cortisol, dopamine, oxytocin, serotonin (0–1). Missing components fall back to baseline. |
Writes the agent's current emotional state (VAD mood + hormone analogues) and re-derives the mood bucket from it.
Response
| Field | Type | Allowed | Description |
|---|---|---|---|
agent_id | string | — | Echoed agent key. |
status | string | — | Agent status. |
current_bucket | string | — | Re-derived mood bucket. |
mood | — | — | The stored mood components. |
hormones | — | — | The stored hormone snapshot. |
source | string | stored, default | Whether the state was stored or is the fallback. |
Example
curl -X PUT https://therobot.is/api/v1/memory/agents/project-aria/mood \
-H "Authorization: Bearer trm_api_EXAMPLE" \
-H "Content-Type: application/json" \
-d '{"mood": {"valence": -0.6, "arousal": 0.8, "dominance": 0.4}}'Errors
401{ "error": "Authentication required" }A well-formed but unknown or revoked trm_ bearer. The response does not say which.
403{ "error": "writes are off for this credential" }A credential without writes_enabled=true hit a write endpoint.
404{ "error": "not found" }Unknown or foreign agent key — at the agent level the two are deliberately the same answer, so no existence leaks.