> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a memory

> Update a memory entry's content.

`POST /api/v1/cloud/memory_stores/{memory_store_id}/memories/{memory_id}`

Updates a memory entry. A new version snapshot is created automatically.

## Path parameters

| Parameter         | Description                   |
| ----------------- | ----------------------------- |
| `memory_store_id` | The store ID (`memstore_...`) |
| `memory_id`       | The memory ID (`mem_...`)     |

## Headers

| Header          | Required | Description        |
| --------------- | -------- | ------------------ |
| `Authorization` | Yes      | `Bearer <PAT>`     |
| `Content-Type`  | Yes      | `application/json` |

## Request body

| Field            | Type   | Required | Description                                                                       |
| ---------------- | ------ | -------- | --------------------------------------------------------------------------------- |
| `content`        | string | Yes      | New content, up to 100 KB                                                         |
| `content_sha256` | string | No       | Expected SHA-256 for optimistic concurrency. Returns 409 on mismatch              |
| `metadata`       | object | No       | Key-value tags. Up to 16 pairs; keys 1–64 characters; values up to 512 characters |

## Example request

```bash theme={null}
curl -X POST "https://api.qoder.com/api/v1/cloud/memory_stores/memstore_xxx/memories/mem_xxx" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "# Updated content",
    "content_sha256": "a1b2c3..."
  }'
```

## Response

Returns the updated [Memory object](/cloud-agents/api/memory-stores/schemas#memory-object) with `content` included.

## Errors

| HTTP | Type                    | Trigger                                |
| ---- | ----------------------- | -------------------------------------- |
| 400  | `invalid_request_error` | Blank or oversized content             |
| 404  | `not_found_error`       | Store or memory does not exist         |
| 409  | `invalid_request_error` | Store is archived, or SHA-256 mismatch |
