---
title: "Save or update a memory by name"
method: POST
path: "/memory"
tags: ["memory"]
---

# Save or update a memory by name

`POST /memory`

## Request

- Base URL: `https://aistoryhub.co/api/v1`
- URL: `https://aistoryhub.co/api/v1/memory`
- Auth: HTTP bearer

Reusing an existing name overwrites it instead of creating a duplicate.

## Request body

- object
  - `type` 'preference' | 'feedback' | 'context' | 'reference', required
  - `name` string, required: Short slug identifying this memory. Reusing an existing name overwrites it.
  - `description` string, required: One-line summary shown in every future briefing.
  - `content` string, required
  - `scope` 'story' | 'account'
  - `story_id` string, uuid: Required when scope is "story".

## Response `200`

The saved memory.

- Memory
  - `name` string
  - `type` 'preference' | 'feedback' | 'context' | 'reference'
  - `description` string
  - `content` string
  - `scope` 'story' | 'account'
  - `story_id` string, uuid, nullable
  - `updated_at` string, date-time, nullable

## Other responses

- `400`: The request body or parameters are invalid.
- `401`: Missing, malformed, invalid, revoked, or expired token.
- `403`: The token lacks the scope this endpoint requires.
- `429`: Too many requests. Retry after the delay in the `Retry-After` header.

---

[API](https://skmtc.dev/aistoryhub/apis/aistoryhub-api.md) · [All operations](https://skmtc.dev/aistoryhub/apis/aistoryhub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aistoryhub/apis/aistoryhub-api/revisions/0cfd2c14ae12?raw)
