SPB Git

Repository Public

memory_stores.md 78.0 KB 3,112 lines markdown

1---2title: Memory Stores3url: https://platform.claude.com/docs/en/api/beta/memory_stores4---56# Memory Stores78## Create a memory store910**POST** `/v1/memory_stores`1112Create a memory store1314### Headers1516- `"anthropic-beta": optional array of AnthropicBeta`1718  Optional header to specify the beta version(s) you want to use.1920  - `string`2122  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2324    - `"message-batches-2024-09-24"`2526    - `"prompt-caching-2024-07-31"`2728    - `"computer-use-2024-10-22"`2930    - `"computer-use-2025-01-24"`3132    - `"pdfs-2024-09-25"`3334    - `"token-counting-2024-11-01"`3536    - `"token-efficient-tools-2025-02-19"`3738    - `"output-128k-2025-02-19"`3940    - `"files-api-2025-04-14"`4142    - `"mcp-client-2025-04-04"`4344    - `"mcp-client-2025-11-20"`4546    - `"dev-full-thinking-2025-05-14"`4748    - `"interleaved-thinking-2025-05-14"`4950    - `"code-execution-2025-05-22"`5152    - `"extended-cache-ttl-2025-04-11"`5354    - `"context-1m-2025-08-07"`5556    - `"context-management-2025-06-27"`5758    - `"model-context-window-exceeded-2025-08-26"`5960    - `"skills-2025-10-02"`6162    - `"fast-mode-2026-02-01"`6364    - `"output-300k-2026-03-24"`6566    - `"user-profiles-2026-03-24"`6768    - `"user-profiles-2026-08-18"`6970    - `"user-profiles-2026-09-04"`7172    - `"advisor-tool-2026-03-01"`7374    - `"managed-agents-2026-04-01"`7576    - `"cache-diagnosis-2026-04-07"`7778    - `"dreaming-2026-04-21"`7980    - `"thinking-token-count-2026-05-13"`8182    - `"server-side-fallback-2026-06-01"`8384    - `"server-side-fallback-2026-07-01"`8586    - `"fallback-credit-2026-06-01"`8788    - `"fallback-credit-2026-07-01"`8990    - `"agent-memory-2026-07-22"`9192    - `"mid-conversation-tool-changes-2026-07-01"`9394    - `"compact-2026-01-12"`9596    - `"computer-use-2025-11-24"`9798    - `"mcp-tunnels-2026-06-22"`99100    - `"structured-outputs-2025-11-13"`101102    - `"task-budgets-2026-03-13"`103104    - `"thinking-display-updates-2026-08-18"`105106    - `"ce-user-management-2026-07-13"`107108    - `"mid-conversation-output-config-2026-07-01"`109110    - `"thinking-binding-controls-2026-08-01"`111112    - `"mid-conversation-system-clear-at-2026-08-21"`113114    - `"compact-2026-09-04"`115116- `"anthropic-workspace-id": optional string`117118### Body parameters119120- `name: string`121122  Human-readable name for the store. Required; 1–255 characters; no control characters. The mount-path slug under `/mnt/memory/` is derived from this name (lowercased, non-alphanumeric runs collapsed to a hyphen). Names need not be unique within a workspace.123124  minLength: 1, maxLength: 255125126- `description: optional string`127128  Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent.129130  maxLength: 1024131132- `metadata: optional map[string]`133134  Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Not visible to the agent.135136### Returns137138- `BetaManagedAgentsMemoryStore object`139140  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.141142  - `type: "memory_store"`143144  - `id: string`145146    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.147148  - `created_at: string`149150    A timestamp in RFC 3339 format151152    format: date-time153154  - `name: string`155156    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.157158  - `updated_at: string`159160    A timestamp in RFC 3339 format161162    format: date-time163164  - `archived_at: optional string or null`165166    A timestamp in RFC 3339 format167168    format: date-time169170  - `description: optional string`171172    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.173174  - `metadata: optional map[string]`175176    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.177178### Example179180```bash181curl https://api.anthropic.com/v1/memory_stores \182    -H 'Content-Type: application/json' \183    -H 'anthropic-version: 2023-06-01' \184    -H 'anthropic-beta: agent-memory-2026-07-22' \185    -H "X-Api-Key: $ANTHROPIC_API_KEY" \186    -d '{187          "name": "x"188        }'189```190191#### Response (200)192193```json194{195  "id": "id",196  "created_at": "2019-12-27T18:11:19.117Z",197  "name": "name",198  "type": "memory_store",199  "updated_at": "2019-12-27T18:11:19.117Z",200  "archived_at": "2019-12-27T18:11:19.117Z",201  "description": "description",202  "metadata": {203    "foo": "string"204  }205}206```207208## List memory stores209210**GET** `/v1/memory_stores`211212List memory stores213214### Query parameters215216- `"created_at[gte]": optional string`217218  Return only stores whose `created_at` is at or after this time (inclusive). Sent on the wire as `created_at[gte]`.219220  format: date-time221222- `"created_at[lte]": optional string`223224  Return only stores whose `created_at` is at or before this time (inclusive). Sent on the wire as `created_at[lte]`.225226  format: date-time227228- `include_archived: optional boolean`229230  When `true`, archived stores are included in the results. Defaults to `false` (archived stores are excluded).231232- `limit: optional number`233234  Maximum number of stores to return per page. Must be between 1 and 100. Defaults to 20 when omitted.235236  format: int32237238- `page: optional string`239240  Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page.241242### Headers243244- `"anthropic-beta": optional array of AnthropicBeta`245246  Optional header to specify the beta version(s) you want to use.247248  - `string`249250  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`251252    - `"message-batches-2024-09-24"`253254    - `"prompt-caching-2024-07-31"`255256    - `"computer-use-2024-10-22"`257258    - `"computer-use-2025-01-24"`259260    - `"pdfs-2024-09-25"`261262    - `"token-counting-2024-11-01"`263264    - `"token-efficient-tools-2025-02-19"`265266    - `"output-128k-2025-02-19"`267268    - `"files-api-2025-04-14"`269270    - `"mcp-client-2025-04-04"`271272    - `"mcp-client-2025-11-20"`273274    - `"dev-full-thinking-2025-05-14"`275276    - `"interleaved-thinking-2025-05-14"`277278    - `"code-execution-2025-05-22"`279280    - `"extended-cache-ttl-2025-04-11"`281282    - `"context-1m-2025-08-07"`283284    - `"context-management-2025-06-27"`285286    - `"model-context-window-exceeded-2025-08-26"`287288    - `"skills-2025-10-02"`289290    - `"fast-mode-2026-02-01"`291292    - `"output-300k-2026-03-24"`293294    - `"user-profiles-2026-03-24"`295296    - `"user-profiles-2026-08-18"`297298    - `"user-profiles-2026-09-04"`299300    - `"advisor-tool-2026-03-01"`301302    - `"managed-agents-2026-04-01"`303304    - `"cache-diagnosis-2026-04-07"`305306    - `"dreaming-2026-04-21"`307308    - `"thinking-token-count-2026-05-13"`309310    - `"server-side-fallback-2026-06-01"`311312    - `"server-side-fallback-2026-07-01"`313314    - `"fallback-credit-2026-06-01"`315316    - `"fallback-credit-2026-07-01"`317318    - `"agent-memory-2026-07-22"`319320    - `"mid-conversation-tool-changes-2026-07-01"`321322    - `"compact-2026-01-12"`323324    - `"computer-use-2025-11-24"`325326    - `"mcp-tunnels-2026-06-22"`327328    - `"structured-outputs-2025-11-13"`329330    - `"task-budgets-2026-03-13"`331332    - `"thinking-display-updates-2026-08-18"`333334    - `"ce-user-management-2026-07-13"`335336    - `"mid-conversation-output-config-2026-07-01"`337338    - `"thinking-binding-controls-2026-08-01"`339340    - `"mid-conversation-system-clear-at-2026-08-21"`341342    - `"compact-2026-09-04"`343344- `"anthropic-workspace-id": optional string`345346### Returns347348- `data: optional array of BetaManagedAgentsMemoryStore`349350  Memory stores on this page, newest first. Empty when there are no stores matching the filters.351352  - `type: "memory_store"`353354  - `id: string`355356    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.357358  - `created_at: string`359360    A timestamp in RFC 3339 format361362    format: date-time363364  - `name: string`365366    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.367368  - `updated_at: string`369370    A timestamp in RFC 3339 format371372    format: date-time373374  - `archived_at: optional string or null`375376    A timestamp in RFC 3339 format377378    format: date-time379380  - `description: optional string`381382    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.383384  - `metadata: optional map[string]`385386    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.387388- `next_page: optional string or null`389390  Opaque cursor for the next page (a `page_...` value). Pass as `page` on the next request. `null` when there are no more results.391392### Example393394```bash395curl https://api.anthropic.com/v1/memory_stores \396    -H 'anthropic-version: 2023-06-01' \397    -H 'anthropic-beta: agent-memory-2026-07-22' \398    -H "X-Api-Key: $ANTHROPIC_API_KEY"399```400401#### Response (200)402403```json404{405  "data": [406    {407      "id": "id",408      "created_at": "2019-12-27T18:11:19.117Z",409      "name": "name",410      "type": "memory_store",411      "updated_at": "2019-12-27T18:11:19.117Z",412      "archived_at": "2019-12-27T18:11:19.117Z",413      "description": "description",414      "metadata": {415        "foo": "string"416      }417    }418  ],419  "next_page": "next_page"420}421```422423## Retrieve a memory store424425**GET** `/v1/memory_stores/{memory_store_id}`426427Retrieve a memory store428429### Path parameters430431- `memory_store_id: string`432433### Headers434435- `"anthropic-beta": optional array of AnthropicBeta`436437  Optional header to specify the beta version(s) you want to use.438439  - `string`440441  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`442443    - `"message-batches-2024-09-24"`444445    - `"prompt-caching-2024-07-31"`446447    - `"computer-use-2024-10-22"`448449    - `"computer-use-2025-01-24"`450451    - `"pdfs-2024-09-25"`452453    - `"token-counting-2024-11-01"`454455    - `"token-efficient-tools-2025-02-19"`456457    - `"output-128k-2025-02-19"`458459    - `"files-api-2025-04-14"`460461    - `"mcp-client-2025-04-04"`462463    - `"mcp-client-2025-11-20"`464465    - `"dev-full-thinking-2025-05-14"`466467    - `"interleaved-thinking-2025-05-14"`468469    - `"code-execution-2025-05-22"`470471    - `"extended-cache-ttl-2025-04-11"`472473    - `"context-1m-2025-08-07"`474475    - `"context-management-2025-06-27"`476477    - `"model-context-window-exceeded-2025-08-26"`478479    - `"skills-2025-10-02"`480481    - `"fast-mode-2026-02-01"`482483    - `"output-300k-2026-03-24"`484485    - `"user-profiles-2026-03-24"`486487    - `"user-profiles-2026-08-18"`488489    - `"user-profiles-2026-09-04"`490491    - `"advisor-tool-2026-03-01"`492493    - `"managed-agents-2026-04-01"`494495    - `"cache-diagnosis-2026-04-07"`496497    - `"dreaming-2026-04-21"`498499    - `"thinking-token-count-2026-05-13"`500501    - `"server-side-fallback-2026-06-01"`502503    - `"server-side-fallback-2026-07-01"`504505    - `"fallback-credit-2026-06-01"`506507    - `"fallback-credit-2026-07-01"`508509    - `"agent-memory-2026-07-22"`510511    - `"mid-conversation-tool-changes-2026-07-01"`512513    - `"compact-2026-01-12"`514515    - `"computer-use-2025-11-24"`516517    - `"mcp-tunnels-2026-06-22"`518519    - `"structured-outputs-2025-11-13"`520521    - `"task-budgets-2026-03-13"`522523    - `"thinking-display-updates-2026-08-18"`524525    - `"ce-user-management-2026-07-13"`526527    - `"mid-conversation-output-config-2026-07-01"`528529    - `"thinking-binding-controls-2026-08-01"`530531    - `"mid-conversation-system-clear-at-2026-08-21"`532533    - `"compact-2026-09-04"`534535- `"anthropic-workspace-id": optional string`536537### Returns538539- `BetaManagedAgentsMemoryStore object`540541  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.542543  - `type: "memory_store"`544545  - `id: string`546547    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.548549  - `created_at: string`550551    A timestamp in RFC 3339 format552553    format: date-time554555  - `name: string`556557    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.558559  - `updated_at: string`560561    A timestamp in RFC 3339 format562563    format: date-time564565  - `archived_at: optional string or null`566567    A timestamp in RFC 3339 format568569    format: date-time570571  - `description: optional string`572573    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.574575  - `metadata: optional map[string]`576577    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.578579### Example580581```bash582curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID \583    -H 'anthropic-version: 2023-06-01' \584    -H 'anthropic-beta: agent-memory-2026-07-22' \585    -H "X-Api-Key: $ANTHROPIC_API_KEY"586```587588#### Response (200)589590```json591{592  "id": "id",593  "created_at": "2019-12-27T18:11:19.117Z",594  "name": "name",595  "type": "memory_store",596  "updated_at": "2019-12-27T18:11:19.117Z",597  "archived_at": "2019-12-27T18:11:19.117Z",598  "description": "description",599  "metadata": {600    "foo": "string"601  }602}603```604605## Update a memory store606607**POST** `/v1/memory_stores/{memory_store_id}`608609Update a memory store610611### Path parameters612613- `memory_store_id: string`614615### Headers616617- `"anthropic-beta": optional array of AnthropicBeta`618619  Optional header to specify the beta version(s) you want to use.620621  - `string`622623  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`624625    - `"message-batches-2024-09-24"`626627    - `"prompt-caching-2024-07-31"`628629    - `"computer-use-2024-10-22"`630631    - `"computer-use-2025-01-24"`632633    - `"pdfs-2024-09-25"`634635    - `"token-counting-2024-11-01"`636637    - `"token-efficient-tools-2025-02-19"`638639    - `"output-128k-2025-02-19"`640641    - `"files-api-2025-04-14"`642643    - `"mcp-client-2025-04-04"`644645    - `"mcp-client-2025-11-20"`646647    - `"dev-full-thinking-2025-05-14"`648649    - `"interleaved-thinking-2025-05-14"`650651    - `"code-execution-2025-05-22"`652653    - `"extended-cache-ttl-2025-04-11"`654655    - `"context-1m-2025-08-07"`656657    - `"context-management-2025-06-27"`658659    - `"model-context-window-exceeded-2025-08-26"`660661    - `"skills-2025-10-02"`662663    - `"fast-mode-2026-02-01"`664665    - `"output-300k-2026-03-24"`666667    - `"user-profiles-2026-03-24"`668669    - `"user-profiles-2026-08-18"`670671    - `"user-profiles-2026-09-04"`672673    - `"advisor-tool-2026-03-01"`674675    - `"managed-agents-2026-04-01"`676677    - `"cache-diagnosis-2026-04-07"`678679    - `"dreaming-2026-04-21"`680681    - `"thinking-token-count-2026-05-13"`682683    - `"server-side-fallback-2026-06-01"`684685    - `"server-side-fallback-2026-07-01"`686687    - `"fallback-credit-2026-06-01"`688689    - `"fallback-credit-2026-07-01"`690691    - `"agent-memory-2026-07-22"`692693    - `"mid-conversation-tool-changes-2026-07-01"`694695    - `"compact-2026-01-12"`696697    - `"computer-use-2025-11-24"`698699    - `"mcp-tunnels-2026-06-22"`700701    - `"structured-outputs-2025-11-13"`702703    - `"task-budgets-2026-03-13"`704705    - `"thinking-display-updates-2026-08-18"`706707    - `"ce-user-management-2026-07-13"`708709    - `"mid-conversation-output-config-2026-07-01"`710711    - `"thinking-binding-controls-2026-08-01"`712713    - `"mid-conversation-system-clear-at-2026-08-21"`714715    - `"compact-2026-09-04"`716717- `"anthropic-workspace-id": optional string`718719### Body parameters720721- `description: optional string or null`722723  New description for the store, up to 1024 characters. Pass an empty string to clear it.724725  maxLength: 1024726727- `metadata: optional map[string] or null`728729  Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.730731- `name: optional string or null`732733  New human-readable name for the store. 1–255 characters; no control characters. Renaming changes the slug used for the store's `mount_path` in sessions created after the update.734735  minLength: 1, maxLength: 255736737### Returns738739- `BetaManagedAgentsMemoryStore object`740741  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.742743  - `type: "memory_store"`744745  - `id: string`746747    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.748749  - `created_at: string`750751    A timestamp in RFC 3339 format752753    format: date-time754755  - `name: string`756757    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.758759  - `updated_at: string`760761    A timestamp in RFC 3339 format762763    format: date-time764765  - `archived_at: optional string or null`766767    A timestamp in RFC 3339 format768769    format: date-time770771  - `description: optional string`772773    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.774775  - `metadata: optional map[string]`776777    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.778779### Example780781```bash782curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID \783    -H 'Content-Type: application/json' \784    -H 'anthropic-version: 2023-06-01' \785    -H 'anthropic-beta: agent-memory-2026-07-22' \786    -H "X-Api-Key: $ANTHROPIC_API_KEY" \787    -d '{}'788```789790#### Response (200)791792```json793{794  "id": "id",795  "created_at": "2019-12-27T18:11:19.117Z",796  "name": "name",797  "type": "memory_store",798  "updated_at": "2019-12-27T18:11:19.117Z",799  "archived_at": "2019-12-27T18:11:19.117Z",800  "description": "description",801  "metadata": {802    "foo": "string"803  }804}805```806807## Delete a memory store808809**DELETE** `/v1/memory_stores/{memory_store_id}`810811Delete a memory store812813### Path parameters814815- `memory_store_id: string`816817### Headers818819- `"anthropic-beta": optional array of AnthropicBeta`820821  Optional header to specify the beta version(s) you want to use.822823  - `string`824825  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`826827    - `"message-batches-2024-09-24"`828829    - `"prompt-caching-2024-07-31"`830831    - `"computer-use-2024-10-22"`832833    - `"computer-use-2025-01-24"`834835    - `"pdfs-2024-09-25"`836837    - `"token-counting-2024-11-01"`838839    - `"token-efficient-tools-2025-02-19"`840841    - `"output-128k-2025-02-19"`842843    - `"files-api-2025-04-14"`844845    - `"mcp-client-2025-04-04"`846847    - `"mcp-client-2025-11-20"`848849    - `"dev-full-thinking-2025-05-14"`850851    - `"interleaved-thinking-2025-05-14"`852853    - `"code-execution-2025-05-22"`854855    - `"extended-cache-ttl-2025-04-11"`856857    - `"context-1m-2025-08-07"`858859    - `"context-management-2025-06-27"`860861    - `"model-context-window-exceeded-2025-08-26"`862863    - `"skills-2025-10-02"`864865    - `"fast-mode-2026-02-01"`866867    - `"output-300k-2026-03-24"`868869    - `"user-profiles-2026-03-24"`870871    - `"user-profiles-2026-08-18"`872873    - `"user-profiles-2026-09-04"`874875    - `"advisor-tool-2026-03-01"`876877    - `"managed-agents-2026-04-01"`878879    - `"cache-diagnosis-2026-04-07"`880881    - `"dreaming-2026-04-21"`882883    - `"thinking-token-count-2026-05-13"`884885    - `"server-side-fallback-2026-06-01"`886887    - `"server-side-fallback-2026-07-01"`888889    - `"fallback-credit-2026-06-01"`890891    - `"fallback-credit-2026-07-01"`892893    - `"agent-memory-2026-07-22"`894895    - `"mid-conversation-tool-changes-2026-07-01"`896897    - `"compact-2026-01-12"`898899    - `"computer-use-2025-11-24"`900901    - `"mcp-tunnels-2026-06-22"`902903    - `"structured-outputs-2025-11-13"`904905    - `"task-budgets-2026-03-13"`906907    - `"thinking-display-updates-2026-08-18"`908909    - `"ce-user-management-2026-07-13"`910911    - `"mid-conversation-output-config-2026-07-01"`912913    - `"thinking-binding-controls-2026-08-01"`914915    - `"mid-conversation-system-clear-at-2026-08-21"`916917    - `"compact-2026-09-04"`918919- `"anthropic-workspace-id": optional string`920921### Returns922923- `BetaManagedAgentsDeletedMemoryStore object`924925  Confirmation that a `memory_store` was deleted.926927  - `type: "memory_store_deleted"`928929  - `id: string`930931    ID of the deleted memory store (a `memstore_...` identifier). The store and all its memories and versions are no longer retrievable.932933### Example934935```bash936curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID \937    -X DELETE \938    -H 'anthropic-version: 2023-06-01' \939    -H 'anthropic-beta: agent-memory-2026-07-22' \940    -H "X-Api-Key: $ANTHROPIC_API_KEY"941```942943#### Response (200)944945```json946{947  "id": "id",948  "type": "memory_store_deleted"949}950```951952## Archive a memory store953954**POST** `/v1/memory_stores/{memory_store_id}/archive`955956Archive a memory store957958### Path parameters959960- `memory_store_id: string`961962### Headers963964- `"anthropic-beta": optional array of AnthropicBeta`965966  Optional header to specify the beta version(s) you want to use.967968  - `string`969970  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`971972    - `"message-batches-2024-09-24"`973974    - `"prompt-caching-2024-07-31"`975976    - `"computer-use-2024-10-22"`977978    - `"computer-use-2025-01-24"`979980    - `"pdfs-2024-09-25"`981982    - `"token-counting-2024-11-01"`983984    - `"token-efficient-tools-2025-02-19"`985986    - `"output-128k-2025-02-19"`987988    - `"files-api-2025-04-14"`989990    - `"mcp-client-2025-04-04"`991992    - `"mcp-client-2025-11-20"`993994    - `"dev-full-thinking-2025-05-14"`995996    - `"interleaved-thinking-2025-05-14"`997998    - `"code-execution-2025-05-22"`9991000    - `"extended-cache-ttl-2025-04-11"`10011002    - `"context-1m-2025-08-07"`10031004    - `"context-management-2025-06-27"`10051006    - `"model-context-window-exceeded-2025-08-26"`10071008    - `"skills-2025-10-02"`10091010    - `"fast-mode-2026-02-01"`10111012    - `"output-300k-2026-03-24"`10131014    - `"user-profiles-2026-03-24"`10151016    - `"user-profiles-2026-08-18"`10171018    - `"user-profiles-2026-09-04"`10191020    - `"advisor-tool-2026-03-01"`10211022    - `"managed-agents-2026-04-01"`10231024    - `"cache-diagnosis-2026-04-07"`10251026    - `"dreaming-2026-04-21"`10271028    - `"thinking-token-count-2026-05-13"`10291030    - `"server-side-fallback-2026-06-01"`10311032    - `"server-side-fallback-2026-07-01"`10331034    - `"fallback-credit-2026-06-01"`10351036    - `"fallback-credit-2026-07-01"`10371038    - `"agent-memory-2026-07-22"`10391040    - `"mid-conversation-tool-changes-2026-07-01"`10411042    - `"compact-2026-01-12"`10431044    - `"computer-use-2025-11-24"`10451046    - `"mcp-tunnels-2026-06-22"`10471048    - `"structured-outputs-2025-11-13"`10491050    - `"task-budgets-2026-03-13"`10511052    - `"thinking-display-updates-2026-08-18"`10531054    - `"ce-user-management-2026-07-13"`10551056    - `"mid-conversation-output-config-2026-07-01"`10571058    - `"thinking-binding-controls-2026-08-01"`10591060    - `"mid-conversation-system-clear-at-2026-08-21"`10611062    - `"compact-2026-09-04"`10631064- `"anthropic-workspace-id": optional string`10651066### Returns10671068- `BetaManagedAgentsMemoryStore object`10691070  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.10711072  - `type: "memory_store"`10731074  - `id: string`10751076    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.10771078  - `created_at: string`10791080    A timestamp in RFC 3339 format10811082    format: date-time10831084  - `name: string`10851086    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.10871088  - `updated_at: string`10891090    A timestamp in RFC 3339 format10911092    format: date-time10931094  - `archived_at: optional string or null`10951096    A timestamp in RFC 3339 format10971098    format: date-time10991100  - `description: optional string`11011102    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.11031104  - `metadata: optional map[string]`11051106    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.11071108### Example11091110```bash1111curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/archive \1112    -X POST \1113    -H 'anthropic-version: 2023-06-01' \1114    -H 'anthropic-beta: agent-memory-2026-07-22' \1115    -H "X-Api-Key: $ANTHROPIC_API_KEY"1116```11171118#### Response (200)11191120```json1121{1122  "id": "id",1123  "created_at": "2019-12-27T18:11:19.117Z",1124  "name": "name",1125  "type": "memory_store",1126  "updated_at": "2019-12-27T18:11:19.117Z",1127  "archived_at": "2019-12-27T18:11:19.117Z",1128  "description": "description",1129  "metadata": {1130    "foo": "string"1131  }1132}1133```11341135## Domain types11361137### Beta Managed Agents Deleted Memory Store11381139- `BetaManagedAgentsDeletedMemoryStore object`11401141  Confirmation that a `memory_store` was deleted.11421143  - `type: "memory_store_deleted"`11441145  - `id: string`11461147    ID of the deleted memory store (a `memstore_...` identifier). The store and all its memories and versions are no longer retrievable.11481149### Beta Managed Agents Memory Store11501151- `BetaManagedAgentsMemoryStore object`11521153  A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.11541155  - `type: "memory_store"`11561157  - `id: string`11581159    Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls.11601161  - `created_at: string`11621163    A timestamp in RFC 3339 format11641165    format: date-time11661167  - `name: string`11681169    Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name.11701171  - `updated_at: string`11721173    A timestamp in RFC 3339 format11741175    format: date-time11761177  - `archived_at: optional string or null`11781179    A timestamp in RFC 3339 format11801181    format: date-time11821183  - `description: optional string`11841185    Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset.11861187  - `metadata: optional map[string]`11881189    Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable.11901191## Memory Stores › Memories11921193### Create a memory11941195**POST** `/v1/memory_stores/{memory_store_id}/memories`11961197Create a memory11981199#### Path parameters12001201- `memory_store_id: string`12021203#### Query parameters12041205- `view: optional BetaManagedAgentsMemoryView`12061207  Query parameter for view12081209  - `"basic"`12101211  - `"full"`12121213#### Headers12141215- `"anthropic-beta": optional array of AnthropicBeta`12161217  Optional header to specify the beta version(s) you want to use.12181219  - `string`12201221  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`12221223    - `"message-batches-2024-09-24"`12241225    - `"prompt-caching-2024-07-31"`12261227    - `"computer-use-2024-10-22"`12281229    - `"computer-use-2025-01-24"`12301231    - `"pdfs-2024-09-25"`12321233    - `"token-counting-2024-11-01"`12341235    - `"token-efficient-tools-2025-02-19"`12361237    - `"output-128k-2025-02-19"`12381239    - `"files-api-2025-04-14"`12401241    - `"mcp-client-2025-04-04"`12421243    - `"mcp-client-2025-11-20"`12441245    - `"dev-full-thinking-2025-05-14"`12461247    - `"interleaved-thinking-2025-05-14"`12481249    - `"code-execution-2025-05-22"`12501251    - `"extended-cache-ttl-2025-04-11"`12521253    - `"context-1m-2025-08-07"`12541255    - `"context-management-2025-06-27"`12561257    - `"model-context-window-exceeded-2025-08-26"`12581259    - `"skills-2025-10-02"`12601261    - `"fast-mode-2026-02-01"`12621263    - `"output-300k-2026-03-24"`12641265    - `"user-profiles-2026-03-24"`12661267    - `"user-profiles-2026-08-18"`12681269    - `"user-profiles-2026-09-04"`12701271    - `"advisor-tool-2026-03-01"`12721273    - `"managed-agents-2026-04-01"`12741275    - `"cache-diagnosis-2026-04-07"`12761277    - `"dreaming-2026-04-21"`12781279    - `"thinking-token-count-2026-05-13"`12801281    - `"server-side-fallback-2026-06-01"`12821283    - `"server-side-fallback-2026-07-01"`12841285    - `"fallback-credit-2026-06-01"`12861287    - `"fallback-credit-2026-07-01"`12881289    - `"agent-memory-2026-07-22"`12901291    - `"mid-conversation-tool-changes-2026-07-01"`12921293    - `"compact-2026-01-12"`12941295    - `"computer-use-2025-11-24"`12961297    - `"mcp-tunnels-2026-06-22"`12981299    - `"structured-outputs-2025-11-13"`13001301    - `"task-budgets-2026-03-13"`13021303    - `"thinking-display-updates-2026-08-18"`13041305    - `"ce-user-management-2026-07-13"`13061307    - `"mid-conversation-output-config-2026-07-01"`13081309    - `"thinking-binding-controls-2026-08-01"`13101311    - `"mid-conversation-system-clear-at-2026-08-21"`13121313    - `"compact-2026-09-04"`13141315- `"anthropic-workspace-id": optional string`13161317#### Body parameters13181319- `content: string or null`13201321  UTF-8 text content for the new memory. Maximum 100 kB (102,400 bytes). Required; pass `""` explicitly to create an empty memory.13221323- `path: string`13241325  Hierarchical path for the new memory, e.g. `/projects/foo/notes.md`. Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive.13261327  minLength: 2, maxLength: 102413281329#### Returns13301331- `BetaManagedAgentsMemory object`13321333  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.13341335  - `type: "memory"`13361337  - `id: string`13381339    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.13401341  - `content_sha256: string`13421343    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.13441345  - `content_size_bytes: number`13461347    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.13481349    format: int3213501351  - `created_at: string`13521353    A timestamp in RFC 3339 format13541355    format: date-time13561357  - `memory_store_id: string`13581359    ID of the memory store this memory belongs to (a `memstore_...` value).13601361  - `memory_version_id: string`13621363    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list).13641365  - `path: string`13661367    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.13681369  - `updated_at: string`13701371    A timestamp in RFC 3339 format13721373    format: date-time13741375  - `content: optional string or null`13761377    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).13781379#### Example13801381```bash1382curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories \1383    -H 'Content-Type: application/json' \1384    -H 'anthropic-version: 2023-06-01' \1385    -H 'anthropic-beta: agent-memory-2026-07-22' \1386    -H "X-Api-Key: $ANTHROPIC_API_KEY" \1387    -d '{1388          "content": "content",1389          "path": "xx"1390        }'1391```13921393##### Response (200)13941395```json1396{1397  "id": "id",1398  "content_sha256": "content_sha256",1399  "content_size_bytes": 0,1400  "created_at": "2019-12-27T18:11:19.117Z",1401  "memory_store_id": "memory_store_id",1402  "memory_version_id": "memory_version_id",1403  "path": "path",1404  "type": "memory",1405  "updated_at": "2019-12-27T18:11:19.117Z",1406  "content": "content"1407}1408```14091410### List memories14111412**GET** `/v1/memory_stores/{memory_store_id}/memories`14131414List memories14151416#### Path parameters14171418- `memory_store_id: string`14191420#### Query parameters14211422- `depth: optional number`14231424  `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1` behaves like `ls`; omitting `depth` behaves like `find`.14251426  format: int3214271428- `limit: optional number`14291430  Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 when omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items count toward the limit.14311432  format: int3214331434- `page: optional string`14351436  Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous response to fetch the next page; omit for the first page.14371438- `path_prefix: optional string`14391440  Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This value appears in request URLs. Do not include secrets or personally identifiable information.14411442- `view: optional BetaManagedAgentsMemoryView`14431444  Which projection of each `memory` to return. Defaults to `basic` (content omitted). `full` populates `content` on each item and caps `limit` at 20; use this as the bulk-read path for export and sync.14451446  - `"basic"`14471448  - `"full"`14491450#### Headers14511452- `"anthropic-beta": optional array of AnthropicBeta`14531454  Optional header to specify the beta version(s) you want to use.14551456  - `string`14571458  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`14591460    - `"message-batches-2024-09-24"`14611462    - `"prompt-caching-2024-07-31"`14631464    - `"computer-use-2024-10-22"`14651466    - `"computer-use-2025-01-24"`14671468    - `"pdfs-2024-09-25"`14691470    - `"token-counting-2024-11-01"`14711472    - `"token-efficient-tools-2025-02-19"`14731474    - `"output-128k-2025-02-19"`14751476    - `"files-api-2025-04-14"`14771478    - `"mcp-client-2025-04-04"`14791480    - `"mcp-client-2025-11-20"`14811482    - `"dev-full-thinking-2025-05-14"`14831484    - `"interleaved-thinking-2025-05-14"`14851486    - `"code-execution-2025-05-22"`14871488    - `"extended-cache-ttl-2025-04-11"`14891490    - `"context-1m-2025-08-07"`14911492    - `"context-management-2025-06-27"`14931494    - `"model-context-window-exceeded-2025-08-26"`14951496    - `"skills-2025-10-02"`14971498    - `"fast-mode-2026-02-01"`14991500    - `"output-300k-2026-03-24"`15011502    - `"user-profiles-2026-03-24"`15031504    - `"user-profiles-2026-08-18"`15051506    - `"user-profiles-2026-09-04"`15071508    - `"advisor-tool-2026-03-01"`15091510    - `"managed-agents-2026-04-01"`15111512    - `"cache-diagnosis-2026-04-07"`15131514    - `"dreaming-2026-04-21"`15151516    - `"thinking-token-count-2026-05-13"`15171518    - `"server-side-fallback-2026-06-01"`15191520    - `"server-side-fallback-2026-07-01"`15211522    - `"fallback-credit-2026-06-01"`15231524    - `"fallback-credit-2026-07-01"`15251526    - `"agent-memory-2026-07-22"`15271528    - `"mid-conversation-tool-changes-2026-07-01"`15291530    - `"compact-2026-01-12"`15311532    - `"computer-use-2025-11-24"`15331534    - `"mcp-tunnels-2026-06-22"`15351536    - `"structured-outputs-2025-11-13"`15371538    - `"task-budgets-2026-03-13"`15391540    - `"thinking-display-updates-2026-08-18"`15411542    - `"ce-user-management-2026-07-13"`15431544    - `"mid-conversation-output-config-2026-07-01"`15451546    - `"thinking-binding-controls-2026-08-01"`15471548    - `"mid-conversation-system-clear-at-2026-08-21"`15491550    - `"compact-2026-09-04"`15511552- `"anthropic-workspace-id": optional string`15531554#### Returns15551556- `data: optional array of BetaManagedAgentsMemoryListItem`15571558  One page of results. Each item is either a `memory` object or, when `depth` was set, a `memory_prefix` rollup marker. Items are returned in a stable, server-defined order.15591560  - `BetaManagedAgentsMemory object`15611562    A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.15631564    - `type: "memory"`15651566    - `id: string`15671568      Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.15691570    - `content_sha256: string`15711572      Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.15731574    - `content_size_bytes: number`15751576      Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.15771578      format: int3215791580    - `created_at: string`15811582      A timestamp in RFC 3339 format15831584      format: date-time15851586    - `memory_store_id: string`15871588      ID of the memory store this memory belongs to (a `memstore_...` value).15891590    - `memory_version_id: string`15911592      ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list).15931594    - `path: string`15951596      Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.15971598    - `updated_at: string`15991600      A timestamp in RFC 3339 format16011602      format: date-time16031604    - `content: optional string or null`16051606      The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).16071608  - `BetaManagedAgentsMemoryPrefix object`16091610    A rolled-up directory marker returned by [List memories](/docs/en/api/beta/memory_stores/memories/list) when `depth` is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page `limit` and interleaves with `memory` items in path order.16111612    - `type: "memory_prefix"`16131614    - `path: string`16151616      The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to drill into the directory.16171618- `next_page: optional string or null`16191620  Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.16211622#### Example16231624```bash1625curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories \1626    -H 'anthropic-version: 2023-06-01' \1627    -H 'anthropic-beta: agent-memory-2026-07-22' \1628    -H "X-Api-Key: $ANTHROPIC_API_KEY"1629```16301631##### Response (200)16321633```json1634{1635  "data": [1636    {1637      "id": "id",1638      "content_sha256": "content_sha256",1639      "content_size_bytes": 0,1640      "created_at": "2019-12-27T18:11:19.117Z",1641      "memory_store_id": "memory_store_id",1642      "memory_version_id": "memory_version_id",1643      "path": "path",1644      "type": "memory",1645      "updated_at": "2019-12-27T18:11:19.117Z",1646      "content": "content"1647    }1648  ],1649  "next_page": "next_page"1650}1651```16521653### Retrieve a memory16541655**GET** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`16561657Retrieve a memory16581659#### Path parameters16601661- `memory_store_id: string`16621663- `memory_id: string`16641665#### Query parameters16661667- `view: optional BetaManagedAgentsMemoryView`16681669  Query parameter for view16701671  - `"basic"`16721673  - `"full"`16741675#### Headers16761677- `"anthropic-beta": optional array of AnthropicBeta`16781679  Optional header to specify the beta version(s) you want to use.16801681  - `string`16821683  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`16841685    - `"message-batches-2024-09-24"`16861687    - `"prompt-caching-2024-07-31"`16881689    - `"computer-use-2024-10-22"`16901691    - `"computer-use-2025-01-24"`16921693    - `"pdfs-2024-09-25"`16941695    - `"token-counting-2024-11-01"`16961697    - `"token-efficient-tools-2025-02-19"`16981699    - `"output-128k-2025-02-19"`17001701    - `"files-api-2025-04-14"`17021703    - `"mcp-client-2025-04-04"`17041705    - `"mcp-client-2025-11-20"`17061707    - `"dev-full-thinking-2025-05-14"`17081709    - `"interleaved-thinking-2025-05-14"`17101711    - `"code-execution-2025-05-22"`17121713    - `"extended-cache-ttl-2025-04-11"`17141715    - `"context-1m-2025-08-07"`17161717    - `"context-management-2025-06-27"`17181719    - `"model-context-window-exceeded-2025-08-26"`17201721    - `"skills-2025-10-02"`17221723    - `"fast-mode-2026-02-01"`17241725    - `"output-300k-2026-03-24"`17261727    - `"user-profiles-2026-03-24"`17281729    - `"user-profiles-2026-08-18"`17301731    - `"user-profiles-2026-09-04"`17321733    - `"advisor-tool-2026-03-01"`17341735    - `"managed-agents-2026-04-01"`17361737    - `"cache-diagnosis-2026-04-07"`17381739    - `"dreaming-2026-04-21"`17401741    - `"thinking-token-count-2026-05-13"`17421743    - `"server-side-fallback-2026-06-01"`17441745    - `"server-side-fallback-2026-07-01"`17461747    - `"fallback-credit-2026-06-01"`17481749    - `"fallback-credit-2026-07-01"`17501751    - `"agent-memory-2026-07-22"`17521753    - `"mid-conversation-tool-changes-2026-07-01"`17541755    - `"compact-2026-01-12"`17561757    - `"computer-use-2025-11-24"`17581759    - `"mcp-tunnels-2026-06-22"`17601761    - `"structured-outputs-2025-11-13"`17621763    - `"task-budgets-2026-03-13"`17641765    - `"thinking-display-updates-2026-08-18"`17661767    - `"ce-user-management-2026-07-13"`17681769    - `"mid-conversation-output-config-2026-07-01"`17701771    - `"thinking-binding-controls-2026-08-01"`17721773    - `"mid-conversation-system-clear-at-2026-08-21"`17741775    - `"compact-2026-09-04"`17761777- `"anthropic-workspace-id": optional string`17781779#### Returns17801781- `BetaManagedAgentsMemory object`17821783  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.17841785  - `type: "memory"`17861787  - `id: string`17881789    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.17901791  - `content_sha256: string`17921793    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.17941795  - `content_size_bytes: number`17961797    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.17981799    format: int3218001801  - `created_at: string`18021803    A timestamp in RFC 3339 format18041805    format: date-time18061807  - `memory_store_id: string`18081809    ID of the memory store this memory belongs to (a `memstore_...` value).18101811  - `memory_version_id: string`18121813    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list).18141815  - `path: string`18161817    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.18181819  - `updated_at: string`18201821    A timestamp in RFC 3339 format18221823    format: date-time18241825  - `content: optional string or null`18261827    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).18281829#### Example18301831```bash1832curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories/$MEMORY_ID \1833    -H 'anthropic-version: 2023-06-01' \1834    -H 'anthropic-beta: agent-memory-2026-07-22' \1835    -H "X-Api-Key: $ANTHROPIC_API_KEY"1836```18371838##### Response (200)18391840```json1841{1842  "id": "id",1843  "content_sha256": "content_sha256",1844  "content_size_bytes": 0,1845  "created_at": "2019-12-27T18:11:19.117Z",1846  "memory_store_id": "memory_store_id",1847  "memory_version_id": "memory_version_id",1848  "path": "path",1849  "type": "memory",1850  "updated_at": "2019-12-27T18:11:19.117Z",1851  "content": "content"1852}1853```18541855### Update a memory18561857**POST** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`18581859Update a memory18601861#### Path parameters18621863- `memory_store_id: string`18641865- `memory_id: string`18661867#### Query parameters18681869- `view: optional BetaManagedAgentsMemoryView`18701871  Query parameter for view18721873  - `"basic"`18741875  - `"full"`18761877#### Headers18781879- `"anthropic-beta": optional array of AnthropicBeta`18801881  Optional header to specify the beta version(s) you want to use.18821883  - `string`18841885  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`18861887    - `"message-batches-2024-09-24"`18881889    - `"prompt-caching-2024-07-31"`18901891    - `"computer-use-2024-10-22"`18921893    - `"computer-use-2025-01-24"`18941895    - `"pdfs-2024-09-25"`18961897    - `"token-counting-2024-11-01"`18981899    - `"token-efficient-tools-2025-02-19"`19001901    - `"output-128k-2025-02-19"`19021903    - `"files-api-2025-04-14"`19041905    - `"mcp-client-2025-04-04"`19061907    - `"mcp-client-2025-11-20"`19081909    - `"dev-full-thinking-2025-05-14"`19101911    - `"interleaved-thinking-2025-05-14"`19121913    - `"code-execution-2025-05-22"`19141915    - `"extended-cache-ttl-2025-04-11"`19161917    - `"context-1m-2025-08-07"`19181919    - `"context-management-2025-06-27"`19201921    - `"model-context-window-exceeded-2025-08-26"`19221923    - `"skills-2025-10-02"`19241925    - `"fast-mode-2026-02-01"`19261927    - `"output-300k-2026-03-24"`19281929    - `"user-profiles-2026-03-24"`19301931    - `"user-profiles-2026-08-18"`19321933    - `"user-profiles-2026-09-04"`19341935    - `"advisor-tool-2026-03-01"`19361937    - `"managed-agents-2026-04-01"`19381939    - `"cache-diagnosis-2026-04-07"`19401941    - `"dreaming-2026-04-21"`19421943    - `"thinking-token-count-2026-05-13"`19441945    - `"server-side-fallback-2026-06-01"`19461947    - `"server-side-fallback-2026-07-01"`19481949    - `"fallback-credit-2026-06-01"`19501951    - `"fallback-credit-2026-07-01"`19521953    - `"agent-memory-2026-07-22"`19541955    - `"mid-conversation-tool-changes-2026-07-01"`19561957    - `"compact-2026-01-12"`19581959    - `"computer-use-2025-11-24"`19601961    - `"mcp-tunnels-2026-06-22"`19621963    - `"structured-outputs-2025-11-13"`19641965    - `"task-budgets-2026-03-13"`19661967    - `"thinking-display-updates-2026-08-18"`19681969    - `"ce-user-management-2026-07-13"`19701971    - `"mid-conversation-output-config-2026-07-01"`19721973    - `"thinking-binding-controls-2026-08-01"`19741975    - `"mid-conversation-system-clear-at-2026-08-21"`19761977    - `"compact-2026-09-04"`19781979- `"anthropic-workspace-id": optional string`19801981#### Body parameters19821983- `content: optional string or null`19841985  New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a rename-only update).19861987- `path: optional string or null`19881989  New path for the memory (a rename). Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive. The memory's `id` is preserved across renames. Omit to leave the path unchanged.19901991  minLength: 2, maxLength: 102419921993- `precondition: optional BetaManagedAgentsPrecondition`19941995  Optimistic-concurrency precondition: the update applies only if the memory's stored `content_sha256` equals the supplied value. On mismatch, the request returns `memory_precondition_failed_error` (HTTP 409); re-read the memory and retry against the fresh state. If the precondition fails but the stored state already exactly matches the requested `content` and `path`, the server returns 200 instead of 409.19961997  - `type: "content_sha256"`19981999  - `content_sha256: optional string`20002001    Expected `content_sha256` of the stored memory (64 lowercase hexadecimal characters). Typically the `content_sha256` returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.20022003#### Returns20042005- `BetaManagedAgentsMemory object`20062007  A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.20082009  - `type: "memory"`20102011  - `id: string`20122013    Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory.20142015  - `content_sha256: string`20162017    Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`.20182019  - `content_size_bytes: number`20202021    Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`.20222023    format: int3220242025  - `created_at: string`20262027    A timestamp in RFC 3339 format20282029    format: date-time20302031  - `memory_store_id: string`20322033    ID of the memory store this memory belongs to (a `memstore_...` value).20342035  - `memory_version_id: string`20362037    ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list).20382039  - `path: string`20402041    Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes.20422043  - `updated_at: string`20442045    A timestamp in RFC 3339 format20462047    format: date-time20482049  - `content: optional string or null`20502051    The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes).20522053#### Example20542055```bash2056curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories/$MEMORY_ID \2057    -H 'Content-Type: application/json' \2058    -H 'anthropic-version: 2023-06-01' \2059    -H 'anthropic-beta: agent-memory-2026-07-22' \2060    -H "X-Api-Key: $ANTHROPIC_API_KEY" \2061    -d '{}'2062```20632064##### Response (200)20652066```json2067{2068  "id": "id",2069  "content_sha256": "content_sha256",2070  "content_size_bytes": 0,2071  "created_at": "2019-12-27T18:11:19.117Z",2072  "memory_store_id": "memory_store_id",2073  "memory_version_id": "memory_version_id",2074  "path": "path",2075  "type": "memory",2076  "updated_at": "2019-12-27T18:11:19.117Z",2077  "content": "content"2078}2079```20802081### Delete a memory20822083**DELETE** `/v1/memory_stores/{memory_store_id}/memories/{memory_id}`20842085Delete a memory20862087#### Path parameters20882089- `memory_store_id: string`20902091- `memory_id: string`20922093#### Query parameters20942095- `expected_content_sha256: optional string`20962097  Query parameter for expected_content_sha25620982099#### Headers21002101- `"anthropic-beta": optional array of AnthropicBeta`21022103  Optional header to specify the beta version(s) you want to use.21042105  - `string`21062107  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`21082109    - `"message-batches-2024-09-24"`21102111    - `"prompt-caching-2024-07-31"`21122113    - `"computer-use-2024-10-22"`21142115    - `"computer-use-2025-01-24"`21162117    - `"pdfs-2024-09-25"`21182119    - `"token-counting-2024-11-01"`21202121    - `"token-efficient-tools-2025-02-19"`21222123    - `"output-128k-2025-02-19"`21242125    - `"files-api-2025-04-14"`21262127    - `"mcp-client-2025-04-04"`21282129    - `"mcp-client-2025-11-20"`21302131    - `"dev-full-thinking-2025-05-14"`21322133    - `"interleaved-thinking-2025-05-14"`21342135    - `"code-execution-2025-05-22"`21362137    - `"extended-cache-ttl-2025-04-11"`21382139    - `"context-1m-2025-08-07"`21402141    - `"context-management-2025-06-27"`21422143    - `"model-context-window-exceeded-2025-08-26"`21442145    - `"skills-2025-10-02"`21462147    - `"fast-mode-2026-02-01"`21482149    - `"output-300k-2026-03-24"`21502151    - `"user-profiles-2026-03-24"`21522153    - `"user-profiles-2026-08-18"`21542155    - `"user-profiles-2026-09-04"`21562157    - `"advisor-tool-2026-03-01"`21582159    - `"managed-agents-2026-04-01"`21602161    - `"cache-diagnosis-2026-04-07"`21622163    - `"dreaming-2026-04-21"`21642165    - `"thinking-token-count-2026-05-13"`21662167    - `"server-side-fallback-2026-06-01"`21682169    - `"server-side-fallback-2026-07-01"`21702171    - `"fallback-credit-2026-06-01"`21722173    - `"fallback-credit-2026-07-01"`21742175    - `"agent-memory-2026-07-22"`21762177    - `"mid-conversation-tool-changes-2026-07-01"`21782179    - `"compact-2026-01-12"`21802181    - `"computer-use-2025-11-24"`21822183    - `"mcp-tunnels-2026-06-22"`21842185    - `"structured-outputs-2025-11-13"`21862187    - `"task-budgets-2026-03-13"`21882189    - `"thinking-display-updates-2026-08-18"`21902191    - `"ce-user-management-2026-07-13"`21922193    - `"mid-conversation-output-config-2026-07-01"`21942195    - `"thinking-binding-controls-2026-08-01"`21962197    - `"mid-conversation-system-clear-at-2026-08-21"`21982199    - `"compact-2026-09-04"`22002201- `"anthropic-workspace-id": optional string`22022203#### Returns22042205- `BetaManagedAgentsDeletedMemory object`22062207  Tombstone returned by [Delete a memory](/docs/en/api/beta/memory_stores/memories/delete). Deleting a memory does not erase its version history: its versions remain listable via [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) while they are retained (each version is kept for at least the version retention period after it was written, unless the store itself is deleted).22082209  - `type: "memory_deleted"`22102211  - `id: string`22122213    ID of the deleted memory (a `mem_...` value).22142215#### Example22162217```bash2218curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memories/$MEMORY_ID \2219    -X DELETE \2220    -H 'anthropic-version: 2023-06-01' \2221    -H 'anthropic-beta: agent-memory-2026-07-22' \2222    -H "X-Api-Key: $ANTHROPIC_API_KEY"2223```22242225##### Response (200)22262227```json2228{2229  "id": "id",2230  "type": "memory_deleted"2231}2232```22332234## Memory Stores › Memory Versions22352236### List memory versions22372238**GET** `/v1/memory_stores/{memory_store_id}/memory_versions`22392240List memory versions22412242#### Path parameters22432244- `memory_store_id: string`22452246#### Query parameters22472248- `api_key_id: optional string`22492250  Query parameter for api_key_id22512252- `"created_at[gte]": optional string`22532254  Return versions created at or after this time (inclusive).22552256  format: date-time22572258- `"created_at[lte]": optional string`22592260  Return versions created at or before this time (inclusive).22612262  format: date-time22632264- `limit: optional number`22652266  Query parameter for limit22672268  format: int3222692270- `memory_id: optional string`22712272  Query parameter for memory_id22732274- `operation: optional BetaManagedAgentsMemoryVersionOperation`22752276  Query parameter for operation22772278  - `"created"`22792280  - `"modified"`22812282  - `"deleted"`22832284- `page: optional string`22852286  Query parameter for page22872288- `service_account_id: optional string`22892290  Query parameter for service_account_id22912292- `session_id: optional string`22932294  Query parameter for session_id22952296- `view: optional BetaManagedAgentsMemoryView`22972298  Query parameter for view22992300  - `"basic"`23012302  - `"full"`23032304#### Headers23052306- `"anthropic-beta": optional array of AnthropicBeta`23072308  Optional header to specify the beta version(s) you want to use.23092310  - `string`23112312  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`23132314    - `"message-batches-2024-09-24"`23152316    - `"prompt-caching-2024-07-31"`23172318    - `"computer-use-2024-10-22"`23192320    - `"computer-use-2025-01-24"`23212322    - `"pdfs-2024-09-25"`23232324    - `"token-counting-2024-11-01"`23252326    - `"token-efficient-tools-2025-02-19"`23272328    - `"output-128k-2025-02-19"`23292330    - `"files-api-2025-04-14"`23312332    - `"mcp-client-2025-04-04"`23332334    - `"mcp-client-2025-11-20"`23352336    - `"dev-full-thinking-2025-05-14"`23372338    - `"interleaved-thinking-2025-05-14"`23392340    - `"code-execution-2025-05-22"`23412342    - `"extended-cache-ttl-2025-04-11"`23432344    - `"context-1m-2025-08-07"`23452346    - `"context-management-2025-06-27"`23472348    - `"model-context-window-exceeded-2025-08-26"`23492350    - `"skills-2025-10-02"`23512352    - `"fast-mode-2026-02-01"`23532354    - `"output-300k-2026-03-24"`23552356    - `"user-profiles-2026-03-24"`23572358    - `"user-profiles-2026-08-18"`23592360    - `"user-profiles-2026-09-04"`23612362    - `"advisor-tool-2026-03-01"`23632364    - `"managed-agents-2026-04-01"`23652366    - `"cache-diagnosis-2026-04-07"`23672368    - `"dreaming-2026-04-21"`23692370    - `"thinking-token-count-2026-05-13"`23712372    - `"server-side-fallback-2026-06-01"`23732374    - `"server-side-fallback-2026-07-01"`23752376    - `"fallback-credit-2026-06-01"`23772378    - `"fallback-credit-2026-07-01"`23792380    - `"agent-memory-2026-07-22"`23812382    - `"mid-conversation-tool-changes-2026-07-01"`23832384    - `"compact-2026-01-12"`23852386    - `"computer-use-2025-11-24"`23872388    - `"mcp-tunnels-2026-06-22"`23892390    - `"structured-outputs-2025-11-13"`23912392    - `"task-budgets-2026-03-13"`23932394    - `"thinking-display-updates-2026-08-18"`23952396    - `"ce-user-management-2026-07-13"`23972398    - `"mid-conversation-output-config-2026-07-01"`23992400    - `"thinking-binding-controls-2026-08-01"`24012402    - `"mid-conversation-system-clear-at-2026-08-21"`24032404    - `"compact-2026-09-04"`24052406- `"anthropic-workspace-id": optional string`24072408#### Returns24092410- `data: optional array of BetaManagedAgentsMemoryVersion`24112412  One page of `memory_version` objects, ordered by `created_at` descending (newest first), with `id` as tiebreak.24132414  - `type: "memory_version"`24152416  - `id: string`24172418    Unique identifier for this version (a `memver_...` value).24192420  - `created_at: string`24212422    A timestamp in RFC 3339 format24232424    format: date-time24252426  - `memory_id: string`24272428    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.24292430  - `memory_store_id: string`24312432    ID of the memory store this version belongs to (a `memstore_...` value).24332434  - `operation: BetaManagedAgentsMemoryVersionOperation`24352436    The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.24372438    - `"created"`24392440    - `"modified"`24412442    - `"deleted"`24432444  - `content: optional string or null`24452446    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.24472448  - `content_sha256: optional string or null`24492450    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.24512452  - `content_size_bytes: optional number or null`24532454    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.24552456    format: int3224572458  - `created_by: optional BetaManagedAgentsActor`24592460    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).24612462    - `BetaManagedAgentsSessionActor object`24632464      Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.24652466      - `type: "session_actor"`24672468      - `session_id: string`24692470        ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/beta/sessions/retrieve) for further provenance.24712472        minLength: 124732474    - `BetaManagedAgentsAPIActor object`24752476      Attribution for a write made directly via the public API (outside of any session).24772478      - `type: "api_actor"`24792480      - `api_key_id: string`24812482        ID of the API key that performed the write. This identifies the key, not the secret.24832484        minLength: 124852486    - `BetaManagedAgentsUserActor object`24872488      Attribution for a write made by a human user through the Anthropic Console.24892490      - `type: "user_actor"`24912492      - `user_id: string`24932494        ID of the user who performed the write (a `user_...` value).24952496        minLength: 124972498    - `BetaManagedAgentsServiceAccountActor object`24992500      Attribution for a write made by a workload authenticated as a service account, for example via Workload Identity Federation.25012502      - `type: "service_account_actor"`25032504      - `service_account_id: string`25052506        ID of the service account that performed the write (a `svac_...` value).25072508        minLength: 125092510  - `path: optional string or null`25112512    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.25132514  - `redacted_at: optional string or null`25152516    A timestamp in RFC 3339 format25172518    format: date-time25192520  - `redacted_by: optional BetaManagedAgentsActor`25212522    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).25232524- `next_page: optional string or null`25252526  Opaque cursor for the next page (a `page_...` value), or `null` if there are no more results. Pass as `page` on the next request.25272528#### Example25292530```bash2531curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions \2532    -H 'anthropic-version: 2023-06-01' \2533    -H 'anthropic-beta: agent-memory-2026-07-22' \2534    -H "X-Api-Key: $ANTHROPIC_API_KEY"2535```25362537##### Response (200)25382539```json2540{2541  "data": [2542    {2543      "id": "id",2544      "created_at": "2019-12-27T18:11:19.117Z",2545      "memory_id": "memory_id",2546      "memory_store_id": "memory_store_id",2547      "operation": "created",2548      "type": "memory_version",2549      "content": "content",2550      "content_sha256": "content_sha256",2551      "content_size_bytes": 0,2552      "created_by": {2553        "session_id": "x",2554        "type": "session_actor"2555      },2556      "path": "path",2557      "redacted_at": "2019-12-27T18:11:19.117Z",2558      "redacted_by": {2559        "session_id": "x",2560        "type": "session_actor"2561      }2562    }2563  ],2564  "next_page": "next_page"2565}2566```25672568### Retrieve a memory version25692570**GET** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}`25712572Retrieve a memory version25732574#### Path parameters25752576- `memory_store_id: string`25772578- `memory_version_id: string`25792580#### Query parameters25812582- `view: optional BetaManagedAgentsMemoryView`25832584  Query parameter for view25852586  - `"basic"`25872588  - `"full"`25892590#### Headers25912592- `"anthropic-beta": optional array of AnthropicBeta`25932594  Optional header to specify the beta version(s) you want to use.25952596  - `string`25972598  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`25992600    - `"message-batches-2024-09-24"`26012602    - `"prompt-caching-2024-07-31"`26032604    - `"computer-use-2024-10-22"`26052606    - `"computer-use-2025-01-24"`26072608    - `"pdfs-2024-09-25"`26092610    - `"token-counting-2024-11-01"`26112612    - `"token-efficient-tools-2025-02-19"`26132614    - `"output-128k-2025-02-19"`26152616    - `"files-api-2025-04-14"`26172618    - `"mcp-client-2025-04-04"`26192620    - `"mcp-client-2025-11-20"`26212622    - `"dev-full-thinking-2025-05-14"`26232624    - `"interleaved-thinking-2025-05-14"`26252626    - `"code-execution-2025-05-22"`26272628    - `"extended-cache-ttl-2025-04-11"`26292630    - `"context-1m-2025-08-07"`26312632    - `"context-management-2025-06-27"`26332634    - `"model-context-window-exceeded-2025-08-26"`26352636    - `"skills-2025-10-02"`26372638    - `"fast-mode-2026-02-01"`26392640    - `"output-300k-2026-03-24"`26412642    - `"user-profiles-2026-03-24"`26432644    - `"user-profiles-2026-08-18"`26452646    - `"user-profiles-2026-09-04"`26472648    - `"advisor-tool-2026-03-01"`26492650    - `"managed-agents-2026-04-01"`26512652    - `"cache-diagnosis-2026-04-07"`26532654    - `"dreaming-2026-04-21"`26552656    - `"thinking-token-count-2026-05-13"`26572658    - `"server-side-fallback-2026-06-01"`26592660    - `"server-side-fallback-2026-07-01"`26612662    - `"fallback-credit-2026-06-01"`26632664    - `"fallback-credit-2026-07-01"`26652666    - `"agent-memory-2026-07-22"`26672668    - `"mid-conversation-tool-changes-2026-07-01"`26692670    - `"compact-2026-01-12"`26712672    - `"computer-use-2025-11-24"`26732674    - `"mcp-tunnels-2026-06-22"`26752676    - `"structured-outputs-2025-11-13"`26772678    - `"task-budgets-2026-03-13"`26792680    - `"thinking-display-updates-2026-08-18"`26812682    - `"ce-user-management-2026-07-13"`26832684    - `"mid-conversation-output-config-2026-07-01"`26852686    - `"thinking-binding-controls-2026-08-01"`26872688    - `"mid-conversation-system-clear-at-2026-08-21"`26892690    - `"compact-2026-09-04"`26912692- `"anthropic-workspace-id": optional string`26932694#### Returns26952696- `BetaManagedAgentsMemoryVersion object`26972698  A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and are not deleted with the memory; each version is retained for at least the version retention period after it was written, unless the store itself is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.26992700  - `type: "memory_version"`27012702  - `id: string`27032704    Unique identifier for this version (a `memver_...` value).27052706  - `created_at: string`27072708    A timestamp in RFC 3339 format27092710    format: date-time27112712  - `memory_id: string`27132714    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.27152716  - `memory_store_id: string`27172718    ID of the memory store this version belongs to (a `memstore_...` value).27192720  - `operation: BetaManagedAgentsMemoryVersionOperation`27212722    The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.27232724    - `"created"`27252726    - `"modified"`27272728    - `"deleted"`27292730  - `content: optional string or null`27312732    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.27332734  - `content_sha256: optional string or null`27352736    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.27372738  - `content_size_bytes: optional number or null`27392740    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.27412742    format: int3227432744  - `created_by: optional BetaManagedAgentsActor`27452746    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).27472748    - `BetaManagedAgentsSessionActor object`27492750      Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.27512752      - `type: "session_actor"`27532754      - `session_id: string`27552756        ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/beta/sessions/retrieve) for further provenance.27572758        minLength: 127592760    - `BetaManagedAgentsAPIActor object`27612762      Attribution for a write made directly via the public API (outside of any session).27632764      - `type: "api_actor"`27652766      - `api_key_id: string`27672768        ID of the API key that performed the write. This identifies the key, not the secret.27692770        minLength: 127712772    - `BetaManagedAgentsUserActor object`27732774      Attribution for a write made by a human user through the Anthropic Console.27752776      - `type: "user_actor"`27772778      - `user_id: string`27792780        ID of the user who performed the write (a `user_...` value).27812782        minLength: 127832784    - `BetaManagedAgentsServiceAccountActor object`27852786      Attribution for a write made by a workload authenticated as a service account, for example via Workload Identity Federation.27872788      - `type: "service_account_actor"`27892790      - `service_account_id: string`27912792        ID of the service account that performed the write (a `svac_...` value).27932794        minLength: 127952796  - `path: optional string or null`27972798    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.27992800  - `redacted_at: optional string or null`28012802    A timestamp in RFC 3339 format28032804    format: date-time28052806  - `redacted_by: optional BetaManagedAgentsActor`28072808    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).28092810#### Example28112812```bash2813curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions/$MEMORY_VERSION_ID \2814    -H 'anthropic-version: 2023-06-01' \2815    -H 'anthropic-beta: agent-memory-2026-07-22' \2816    -H "X-Api-Key: $ANTHROPIC_API_KEY"2817```28182819##### Response (200)28202821```json2822{2823  "id": "id",2824  "created_at": "2019-12-27T18:11:19.117Z",2825  "memory_id": "memory_id",2826  "memory_store_id": "memory_store_id",2827  "operation": "created",2828  "type": "memory_version",2829  "content": "content",2830  "content_sha256": "content_sha256",2831  "content_size_bytes": 0,2832  "created_by": {2833    "session_id": "x",2834    "type": "session_actor"2835  },2836  "path": "path",2837  "redacted_at": "2019-12-27T18:11:19.117Z",2838  "redacted_by": {2839    "session_id": "x",2840    "type": "session_actor"2841  }2842}2843```28442845### Redact a memory version28462847**POST** `/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact`28482849Redact a memory version28502851#### Path parameters28522853- `memory_store_id: string`28542855- `memory_version_id: string`28562857#### Headers28582859- `"anthropic-beta": optional array of AnthropicBeta`28602861  Optional header to specify the beta version(s) you want to use.28622863  - `string`28642865  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`28662867    - `"message-batches-2024-09-24"`28682869    - `"prompt-caching-2024-07-31"`28702871    - `"computer-use-2024-10-22"`28722873    - `"computer-use-2025-01-24"`28742875    - `"pdfs-2024-09-25"`28762877    - `"token-counting-2024-11-01"`28782879    - `"token-efficient-tools-2025-02-19"`28802881    - `"output-128k-2025-02-19"`28822883    - `"files-api-2025-04-14"`28842885    - `"mcp-client-2025-04-04"`28862887    - `"mcp-client-2025-11-20"`28882889    - `"dev-full-thinking-2025-05-14"`28902891    - `"interleaved-thinking-2025-05-14"`28922893    - `"code-execution-2025-05-22"`28942895    - `"extended-cache-ttl-2025-04-11"`28962897    - `"context-1m-2025-08-07"`28982899    - `"context-management-2025-06-27"`29002901    - `"model-context-window-exceeded-2025-08-26"`29022903    - `"skills-2025-10-02"`29042905    - `"fast-mode-2026-02-01"`29062907    - `"output-300k-2026-03-24"`29082909    - `"user-profiles-2026-03-24"`29102911    - `"user-profiles-2026-08-18"`29122913    - `"user-profiles-2026-09-04"`29142915    - `"advisor-tool-2026-03-01"`29162917    - `"managed-agents-2026-04-01"`29182919    - `"cache-diagnosis-2026-04-07"`29202921    - `"dreaming-2026-04-21"`29222923    - `"thinking-token-count-2026-05-13"`29242925    - `"server-side-fallback-2026-06-01"`29262927    - `"server-side-fallback-2026-07-01"`29282929    - `"fallback-credit-2026-06-01"`29302931    - `"fallback-credit-2026-07-01"`29322933    - `"agent-memory-2026-07-22"`29342935    - `"mid-conversation-tool-changes-2026-07-01"`29362937    - `"compact-2026-01-12"`29382939    - `"computer-use-2025-11-24"`29402941    - `"mcp-tunnels-2026-06-22"`29422943    - `"structured-outputs-2025-11-13"`29442945    - `"task-budgets-2026-03-13"`29462947    - `"thinking-display-updates-2026-08-18"`29482949    - `"ce-user-management-2026-07-13"`29502951    - `"mid-conversation-output-config-2026-07-01"`29522953    - `"thinking-binding-controls-2026-08-01"`29542955    - `"mid-conversation-system-clear-at-2026-08-21"`29562957    - `"compact-2026-09-04"`29582959- `"anthropic-workspace-id": optional string`29602961#### Returns29622963- `BetaManagedAgentsMemoryVersion object`29642965  A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and are not deleted with the memory; each version is retained for at least the version retention period after it was written, unless the store itself is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.29662967  - `type: "memory_version"`29682969  - `id: string`29702971    Unique identifier for this version (a `memver_...` value).29722973  - `created_at: string`29742975    A timestamp in RFC 3339 format29762977    format: date-time29782979  - `memory_id: string`29802981    ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to [List memory versions](/docs/en/api/beta/memory_stores/memory_versions/list) to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained.29822983  - `memory_store_id: string`29842985    ID of the memory store this version belongs to (a `memstore_...` value).29862987  - `operation: BetaManagedAgentsMemoryVersionOperation`29882989    The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.29902991    - `"created"`29922993    - `"modified"`29942995    - `"deleted"`29962997  - `content: optional string or null`29982999    The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set.30003001  - `content_sha256: optional string or null`30023003    Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.30043005  - `content_size_bytes: optional number or null`30063007    Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise.30083009    format: int3230103011  - `created_by: optional BetaManagedAgentsActor`30123013    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).30143015    - `BetaManagedAgentsSessionActor object`30163017      Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.30183019      - `type: "session_actor"`30203021      - `session_id: string`30223023        ID of the session that performed the write (a `sesn_...` value). Look up the session via [Retrieve a session](/docs/en/api/beta/sessions/retrieve) for further provenance.30243025        minLength: 130263027    - `BetaManagedAgentsAPIActor object`30283029      Attribution for a write made directly via the public API (outside of any session).30303031      - `type: "api_actor"`30323033      - `api_key_id: string`30343035        ID of the API key that performed the write. This identifies the key, not the secret.30363037        minLength: 130383039    - `BetaManagedAgentsUserActor object`30403041      Attribution for a write made by a human user through the Anthropic Console.30423043      - `type: "user_actor"`30443045      - `user_id: string`30463047        ID of the user who performed the write (a `user_...` value).30483049        minLength: 130503051    - `BetaManagedAgentsServiceAccountActor object`30523053      Attribution for a write made by a workload authenticated as a service account, for example via Workload Identity Federation.30543055      - `type: "service_account_actor"`30563057      - `service_account_id: string`30583059        ID of the service account that performed the write (a `svac_...` value).30603061        minLength: 130623063  - `path: optional string or null`30643065    The memory's path at the time of this write. `null` if and only if `redacted_at` is set.30663067  - `redacted_at: optional string or null`30683069    A timestamp in RFC 3339 format30703071    format: date-time30723073  - `redacted_by: optional BetaManagedAgentsActor`30743075    Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the [Sessions API](/docs/en/api/beta/sessions/retrieve).30763077#### Example30783079```bash3080curl https://api.anthropic.com/v1/memory_stores/$MEMORY_STORE_ID/memory_versions/$MEMORY_VERSION_ID/redact \3081    -X POST \3082    -H 'anthropic-version: 2023-06-01' \3083    -H 'anthropic-beta: agent-memory-2026-07-22' \3084    -H "X-Api-Key: $ANTHROPIC_API_KEY"3085```30863087##### Response (200)30883089```json3090{3091  "id": "id",3092  "created_at": "2019-12-27T18:11:19.117Z",3093  "memory_id": "memory_id",3094  "memory_store_id": "memory_store_id",3095  "operation": "created",3096  "type": "memory_version",3097  "content": "content",3098  "content_sha256": "content_sha256",3099  "content_size_bytes": 0,3100  "created_by": {3101    "session_id": "x",3102    "type": "session_actor"3103  },3104  "path": "path",3105  "redacted_at": "2019-12-27T18:11:19.117Z",3106  "redacted_by": {3107    "session_id": "x",3108    "type": "session_actor"3109  }3110}3111```3112
Files main
Menu

Theme