Skip to content
Anlyon
Esc
↑↓navigate↵open⌘Jpreview

Remember (store a memory)

Store a piece of knowledge. Content is embedded synchronously and available to recall() immediately.

POST/api/v2/memory
Authorization
AuthorizationBearer token (Anlyon API key) · headerrequired

Workspace API key sent as Authorization: Bearer <key>.

or
better-auth.session_tokenAPI key · cookierequired

Browser session used by dashboard-only operations.

Header parameters
X-Request-Idstring

Optional caller correlation ID. Unsafe or oversized values are replaced.

max length 128
Idempotency-Keystring

Stable retry key for a mutation. The key is claimed atomically before the handler runs, so concurrent retries execute the side effect at most once. Replaying the key for the same request (same method, path, workspace and JSON body) returns the original response with an X-Idempotent-Replay: true header. Reusing the key for a different request returns 409 with error code idempotency_key_reuse. A duplicate arriving while the first is still in flight waits and then replays; if the first does not finish in time the duplicate gets 409 idempotency_request_in_progress. Keys are retained for 24 hours. Only successful (2xx) responses are stored; a failed request frees the key so it can be retried.

min length 1 · max length 255
Request body
requiredapplication/json
contentstringrequired

UTF-8 content up to 32 KB.

min length 1
collectionstring

Collection name or col_ id

metadataobject
ttlSecondsinteger

Optional TTL in seconds

runIdstring

Optional run in this API-key environment for the memory-write span.

min length 1 · max length 100
parentSpanIdstring

Optional parent span within runId.

min length 1 · max length 100
Responses
201

Public memory resource returned with collection and document provenance.

successbooleanrequired
Allowed:true
dataMemoryResourcerequired
Show properties
idstringrequired
matches ^mem_
contentstringrequired
metadataobjectrequired
collectionIdstringrequired
matches ^col_
documentIdstring | nullrequired
matches ^doc_
chunkIndexinteger | nullrequired
min 0
sourcestringrequired
Allowed:apiingestsummary
expiresAtstring<date-time> | nullrequired
createdAtstring<date-time>required
400

Bad Request - Invalid input data

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
401

Unauthorized - Invalid or missing API key

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
402

Payment Required - Usage quota exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
403

Authenticated credential lacks the required scope or workspace access.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
409

The request conflicts with current resource state or a concurrent decision.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
429

Too Many Requests - Rate limit exceeded

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
503

A required provider or platform dependency is not configured or available.

successbooleanrequired
requestIdstringrequired

Correlation ID matching the X-Request-Id response header.

errorobjectrequired
Show properties
codestring
messagestring
detailsobject
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.anlyon.com/api/v2/memory' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": "string",
  "collection": "string",
  "metadata": {},
  "ttlSeconds": 0,
  "runId": "string",
  "parentSpanId": "string"
}'
Response
{
  "success": true,
  "data": {
    "id": "mem_01JABC",
    "content": "Alice prefers concise answers.",
    "metadata": {
      "subject": "Alice"
    },
    "collectionId": "col_01JABC",
    "documentId": null,
    "chunkIndex": null,
    "source": "api",
    "expiresAt": null,
    "createdAt": "2026-07-13T12:00:00Z"
  }
}