← All REST endpoints

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/moodstable

Set the agent's mood

Parameters
NameInTypeRequiredDefaultAllowedDescription
agent_idquerystringrequired——The agent's agent_key (path segment).
moodbody—optional——Object with valence (clamped -1.0–1.0, default 0.0), arousal and dominance (clamped 0–1, default 0.5).
hormonesbody—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

FieldTypeAllowedDescription
agent_idstring—Echoed agent key.
statusstring—Agent status.
current_bucketstring—Re-derived mood bucket.
mood——The stored mood components.
hormones——The stored hormone snapshot.
sourcestringstored, defaultWhether the state was stored or is the fallback.

Example

bash
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.