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

# Create a memory

> Create a new memory entry in a store.

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

Creates a new memory entry. Returns the created memory with `content` included.

## Path parameters

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

## Headers

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

## Request body

| Field      | Type   | Required | Description                                                                       |
| ---------- | ------ | -------- | --------------------------------------------------------------------------------- |
| `path`     | string | Yes      | Entry path, up to 1024 characters. Cannot contain `..`                            |
| `content`  | string | Yes      | Entry content, up to 100 KB                                                       |
| `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" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "decisions/arch-choice.md",
    "content": "# Architecture Decision\n\nChose microservices."
  }'
```

## Response

```json theme={null}
{
  "id": "mem_019e5cdba1b674e4a6a7d4f8c9b3e2a1",
  "type": "memory",
  "memory_store_id": "memstore_019e5cdb9c3f71c3b6505eba937a40b4",
  "path": "decisions/arch-choice.md",
  "content": "# Architecture Decision\n\nChose microservices.",
  "content_size_bytes": 46,
  "content_sha256": "a1b2c3...",
  "version": 1,
  "metadata": {},
  "created_at": "2026-05-18T08:01:00.000Z",
  "updated_at": "2026-05-18T08:01:00.000Z"
}
```

## Errors

| HTTP | Type                    | Trigger                                   |
| ---- | ----------------------- | ----------------------------------------- |
| 400  | `invalid_request_error` | Invalid path, blank or oversized content  |
| 404  | `not_found_error`       | Store does not exist                      |
| 409  | `invalid_request_error` | Store is archived, or path already exists |
