Skip to main content
PUT
Write a memory file
Creates a file or replaces its whole text. Reasons read the change from their next Session on: MEMORY.md is in every Session’s starting context, so keep it short and put detail in topic notes, which a Session reads when it needs them. Personal memory is available in workspaces with a personal drive; team-only workspaces require scope=team (409 workspace_memory_scope_required otherwise). Team memory takes direct writes from any Workspace member but a viewer (403 for a viewer). The change is stored as a revision under the caller’s name with no source Session, so it shows in memory history and can be restored. Paths are normalized (lower case, .md added); empty text (for a note), text over the size limit (32 KiB a note, 12 KiB MEMORY.md), or text holding a secret or instructions aimed at a later Session is refused with 422, and a new note in a folder that already holds 200 answers 409. Personal memory that its owner turned off cannot change (409 memory_disabled). Scope: memory:write

Authorizations

Authorization
string
header
required

Your Reason API key from Settings › API keys. New keys use reason_; legacy ara_ keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).

Scopes

memory:write

Headers

Idempotency-Key
string

Required when a delegated job credential invokes this mutation. Use a distinct key for each intended effect. This identifies the attempt; it does not make a non-replayable mutation safe to repeat. Ordinary credentials retain the route's existing semantics.

Required string length: 1 - 200

Path Parameters

orgId
string
required

Organization id or slug. Resolve it with GET /v3/self.

Body

application/json
scope
enum<string>
required

team: the Workspace's shared memory. Legacy workspaces also support personal; consolidated workspace resources return 409 workspace_memory_scope_required for personal scope, for every key: retry with scope=team.

Available options:
personal,
team
path
string
required

The file's path within the scope: MEMORY.md (the index) or a note such as web-app.md. A name without an extension gets .md, and paths are lower case, so Web-App and web-app.md are one note. Personal notes may sit in up to three folders (projects/web-app.md); team notes sit at the top or in a place folder such as reasons/<key>/. A memory:/ or team:/ prefix is accepted and ignored.

content
string
required

The file's complete new text; it replaces what the file holds. A note needs some text and at most 32 KiB; MEMORY.md at most 12 KiB. Text holding a secret, or instructions aimed at a later Session, is refused.

expected_revision_id
string | null

The revision_id of the file as last read: the write is refused with 409 when the file has changed since. null requires that the file does not exist yet. Leave it out to replace whatever the file holds.

Response

The file as stored.

scope
enum<string>
required

team: the Workspace's shared memory. Legacy workspaces also support personal; consolidated workspace resources return 409 workspace_memory_scope_required for personal scope, for every key: retry with scope=team.

Available options:
personal,
team
file
object
required
updated
boolean
required

False when the file already held this text, so nothing changed.