Export
Everything memory holds for one app user, a page at a time - for a person who asks for a copy of theirs.
- Auth
- read key
- Cost
- free; never refused
Hands back everything memory holds for one app user, in pages: each item you added, whole; what their
connected apps delivered; the facts memory learned; and, on a key that writes, the earlier versions of
items an edit replaced. Use it when a person asks for a copy of what you keep about them. To show a list in
your app, use items or facts instead: they are shorter, and an item there is
cut at 2,000 characters, where the export keeps it whole.
Call it with no cursor, then again with each page's next until next is null. Every entry comes back
exactly once. Items and what connected apps delivered (event entries) come first, by when they happened; then items still
queued; then facts, by when they were said; then versions. Something added while you page through is on a
later page if it sorts after where you are.
What was forgotten or has expired is not in it. For an app user nothing was written for, it
answers 200 with no entries, never 404.
Headers
AuthorizationstringrequiredBearer ax_…. A read key exports everything but the versions an edit replaced, and says so in
withheld; a key that writes exports those too. See Versions and edits.
X-Alexein-UserstringrequiredThe app user whose memory to export. See App users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
limitintegerHow many entries a page holds, 1 to 500. Default 200.
cursorstringThe next the previous page answered with, for the page after it. Leave it out for the first page.
Response
userstringX-Alexein-User named them.exported_atstringentriesobject[]Each has a type:
item: an item asaddwas given it (id,kind,text,title,at,author,session,about,metadata,expires, each where set), withrole,status(storedorqueued) andadded_at, when memory took it.event: what a connected app delivered:provider,source,kind,place,title,text,url,people(each withrole,name,handle,emailwhere known, andself),occurred_atandadded_at.fact: what memory learned:ref,textled by its date,dateit was said, andfromanduntilwhen it held, where known.version: an earlier version of an item, in the item's fields, with itsversionnumber,taken_atandreplaced_at. Only on a key that writes.
nextstring | nullThe cursor of the next page. null on the last page.
withheldstring[]The entry types this key was not given: ["version"] on a read key, [] on a key that writes.
Errors
400bad requestX-Alexein-User is missing or not a usable id.
401unauthorizedThe bearer is not a key this service issued.
403forbiddenThe organisation has been closed in the console.
422invalidA limit outside 1 to 500, or a cursor that is not a page's next (`cursor` is not the `next` of a page).
429too many requestsPast your organisation's rate limits. Retry after Retry-After seconds. See
Limits.
503unavailableThe service is busy or briefly unavailable. Retry after Retry-After seconds, or with backoff when
there is none.
curl https://api.alexein.ai/v2/memory/export \
-H "Authorization: Bearer $ALEXEIN_API_KEY" \
-H "X-Alexein-User: user_42" \
-H "Content-Type: application/json" \
-d '{ "limit": 200 }'{
"user": "user_42",
"exported_at": "2026-10-21T16:40:09+00:00",
"entries": [
{
"type": "item",
"id": "pref-diet",
"kind": "note",
"text": "Alice is vegan and allergic to peanuts.",
"at": "2026-10-02T12:00:00+00:00",
"metadata": { "source": "crm" },
"status": "stored",
"added_at": "2026-10-09T08:41:17+00:00"
},
{
"type": "fact",
"ref": "mem_Qy7cT0vVbN3rLm8wKs2HdA5fZe9XgJ1uPo4iRt6yWq0BnM3cSx7kLv",
"text": "[2026-10-02] Alice is vegan",
"date": "2026-10-02T12:00:00+00:00",
"from": "2026-10-02T12:00:00+00:00",
"until": null
}
],
"next": "cur_8ZpX2mQ4vL7nR1tY5wK9sD3fH6jB0cG",
"withheld": ["version"]
}{ "user": "bob", "exported_at": "2026-10-21T16:40:09+00:00", "entries": [], "next": null, "withheld": [] }Didn’t find what you needed? Ask the team