Skip to main content
Memory Stores

Update a Memory

Update the content or metadata of a Memory entry.

Updates a Memory's content or metadata. Every update automatically produces a version snapshot with operation=updated. Include content_sha256 for optimistic concurrency control. If it does not match the current server-side content hash, a concurrent write has occurred and the endpoint returns 409. Omit the field to skip the check.

Path

POST /api/v1/forward/memory_stores/{memory_store_id}/memories/{memory_id}

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or admin SAT>
Content-TypeYesapplication/json

Path parameters

ParameterTypeRequiredDescription
memory_store_idstringYesMemory Store ID (memstore_...).
memory_idstringYesMemory ID (mem_...).

Request body

FieldTypeRequiredDescription
contentstringYesNew plain-text UTF-8 content. The raw content is limited to 100 KiB. See Content constraints.
content_sha256stringNoExpected SHA-256 of the current content for optimistic concurrency control. A mismatch returns 409.
metadataobjectNoNew metadata. It replaces the current metadata instead of being merged. Omit it to preserve the current metadata. See Memory metadata constraints.
path cannot be updated. To change it, delete the original Memory and create a new one.

Example request

curl -X POST "https://api.qoder.com/api/v1/forward/memory_stores/memstore_00mc7mukn7lkxr454tjd/memories/mem_00mc7mvag5u68kkfvxhy" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "# Architecture decision v2\n\nUse a modular monolith.",
    "content_sha256": "1712de0d497a5aeef2beeccf4fbb7d5a16944975438d0c25447b9c1fba13099a"
  }'

Example response

HTTP 200 OK
{
  "id": "mem_00mc7mvag5u68kkfvxhy",
  "type": "memory",
  "memory_store_id": "memstore_00mc7mukn7lkxr454tjd",
  "path": "decisions/arch-choice.md",
  "content": "# Architecture decision v2\n\nUse a modular monolith.",
  "content_size_bytes": 108,
  "content_sha256": "9a4f8d2c1b7e6543210fedcba9876543210fedcba9876543210fedcba987654",
  "metadata": {"owner": "backend-team"},
  "created_at": "2026-08-14T10:00:00Z",
  "updated_at": "2026-08-14T11:00:00Z"
}

Response

Returns the updated Memory object, including content.

Notes

Memories in an archived Memory Store cannot be updated. The endpoint returns 409.

Errors

HTTPTypeTrigger
400invalid_request_errorcontent is missing or invalid, exceeds 100 KiB, contains non-printable control characters, or metadata violates its constraints.
401authentication_errorThe authentication token is missing or invalid.
403permission_errorThe caller cannot access the resource.
404not_found_errorThe Memory Store or Memory does not exist, or is not visible across users.
409conflict_errorcontent_sha256 does not match the current content because of a concurrent write, or the Store is archived.
500/502/503api_errorForward or a dependent service failed.