POST · Create memory export

Async export of memories to JSON, NDJSON, or CSV with filters.

POST /api/memories/exports

Kick off an export job. For small result sets the job runs synchronously and the response includes the inline payload. For larger sets (over 10 000 rows) the job is queued — poll GET /api/memories/exports/:id until status: "completed".

curl -X POST https://www.mnueron.com/api/memories/exports \
  -H "Authorization: Bearer $MNUERON_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "namespace": "preferences",
    "format": "ndjson",
    "created_after": 1735689600000
  }'

Body

FieldTypeDefaultNotes
formatstringjsonjson / ndjson / csv
namespacestringRestrict to a project
tagsstring[]tags @> filter
metadata_filterobjectJSONB @> containment
created_after / created_beforeintEpoch ms

Response

201 Created

{
  "id": "01HQ…",
  "status": "completed",
  "format": "ndjson",
  "row_count": 1432,
  "filters": { "namespace": "preferences", "tags": null, "metadata_filter": null,
               "created_after": 1735689600000, "created_before": null },
  "payload": "{...}\n{...}\n{...}",
  "download_url": null,
  "created_at": 1737070000000,
  "completed_at": 1737070000400
}
  • payload is included inline for small results (≤ 10 000 rows). It's a JSON string in json mode, newline-delimited JSON in ndjson mode, RFC-4180 CSV in csv mode.
  • download_url is populated by the background worker once large results have been materialized to object storage.
  • status cycles pending → running → completed | failed.

For very large exports (over 10 000 rows) the response is:

{ "id": "01HQ…", "status": "pending", "row_count": 23104, "payload": null,}

— poll the get-export endpoint.

Formats

  • json — single JSON array of memory rows
  • ndjson — one JSON object per line (streaming-friendly)
  • csv — RFC-4180 CSV with header row id,content,namespace,tags,source,source_ref,created_at,updated_at. Multi-row content and tags arrays are quoted.
Last updated 2026-05-24edit