POST /api/memories
Save a single memory. The body of the memory is required; everything else is optional.
Request
curl -X POST https://www.mnueron.com/api/memories \
-H "Authorization: Bearer $MNUERON_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Prefers 2-space indentation in JavaScript",
"namespace": "preferences",
"tags": ["style", "js"],
"source": "claude-desktop",
"metadata": { "captured_at": 1737070000000 }
}'
Body
| Field | Type | Required | Notes |
|---|---|---|---|
content | string | yes | Up to 256 KB |
namespace | string | no | Default "default"; auto-created |
tags | string[] | no | Free-form |
source | string | no | Default "agent" |
source_ref | string | no | Caller-supplied id (e.g. a chat conversation id) for joining |
metadata | object | no | JSON. Special keys: extract_facts, extract_entities, summarize, byok_anthropic_key, byok_openai_key |
Special metadata flags
metadata.extract_entities: true— force entity extraction even on short content (bypasses the 200-char floor).metadata.extract_facts: true— kick off fact extraction in the background (paid plan / BYOK).metadata.summarize: true— generate an LLM synopsis (paid plan / BYOK).metadata.byok_anthropic_key/metadata.byok_openai_key— use the caller's own LLM key for this save instead of Mnueron's. Stripped from persisted metadata — the key is used for this call only and never stored.
Response
201 Created
{
"id": "01HQB9R3MV…",
"content": "Prefers 2-space indentation in JavaScript",
"namespace": "preferences",
"tags": ["style", "js"],
"source": "claude-desktop",
"source_ref": null,
"metadata": { "captured_at": 1737070000000 },
"created_at": 1737070000000,
"updated_at": 1737070000000
}
Errors
| Status | error | Notes |
|---|---|---|
400 | invalid json / content required | |
402 | memory_quota_exceeded | Free tier capped at 500 memories. Body includes quota + upgrade_url. |
402 | storage_quota_exceeded | Free tier capped at 50 MB. |
413 | memory_too_large | content exceeded 256 KB. Body includes max_bytes, received_bytes. |
429 | rate-limited | 60 writes/min per token |
Side effects
- Secrets are server-side redacted before insert (13 regex patterns + Bearer/Basic-auth heuristics). When something is redacted,
metadata.redacted_countandmetadata.redacted_kindsare stamped on the row. - The
memory.savedwebhook fires for any endpoint subscribed to that event (see Webhooks). - On paid plans (or with BYOK), entity extraction + auto-synopsis + fact extraction run in the background.