Docs

API reference

Every memlane REST endpoint with its method, path, and operationId, each with a page where you can try it.

Base URL: https://api.memlane.sh. Authenticate with Authorization: Bearer om_... or X-API-Key: om_... on every endpoint except the ones that work without one: device connect, creating a space (which the service refuses: use device connect), accepting an invite, and using a recovery code. MCP clients can also sign in with OAuth; the REST API takes keys.

Every endpoint has its own page with a playground that sends real requests, code samples, and its request and response fields. Click an operationId below to open one.

To try the API, get a key first with device connect: you sign in, pick a memory, and get an api_key. Then on any endpoint paste it into the Authorization field, after Bearer . Requests go straight from your browser to https://api.memlane.sh. The key stays in that browser tab's session storage until you close the tab. There is no page for embedding_key_set: set your OpenAI key in a terminal.

The operationId values are stable. Tool generators that import the OpenAPI document (for example Guild) use them as tool names.

Connect

MethodPathoperationIdSummary
POST/v1/connectconnect_startStart connecting an agent. Returns a link and a short code to show the person, and a device_code. No auth. Rate limited per IP.
POST/v1/connect/tokenconnect_tokenPoll with the device_code. 400 authorization_pending until the person signs in, picks a memory, and approves; then the agent's own api_key, once. No auth.

Space

MethodPathoperationIdSummary
POST/v1/spacesspace_createCreate a memory space and get its key, with no account. The service refuses it with 403 account_required and a pointer to device connect: use POST /v1/connect. No auth. Rate limited per IP.
GET/v1/spacespace_getSettings, usage, limits, warnings (limits 80% used or more), and delete_after.
PATCH/v1/spacespace_updateChange name, timezone, or dream_mode. Owners only.
DELETE/v1/spacespace_deleteDelete the space and everything in it. Owners only.
GET/v1/exportspace_exportExport everything as JSON.
POST/v1/space/keyspace_key_rotateReplace your key. Your old one stops working at once; other members' keys don't change, and everything in the space stays.
POST/v1/space/recoveryrecovery_createA new recovery code, shown once. The old one stops working. Owners only.
POST/v1/space/recoverspace_recoverUse the recovery code when every key is lost: adds a new owner and replaces the code. No auth. Rate limited per IP. See Keys and recovery.
GET/v1/space/embeddingsembedding_settings_getShow which embeddings this space uses. Never returns the key.
PUT/v1/space/embeddingsembedding_key_setUse your own OpenAI key. See Your own OpenAI key.
DELETE/v1/space/embeddingsembedding_key_deleteDelete your OpenAI key and go back to the default embeddings.

Members

See Share a memory box. Owner-only operations return 403 forbidden to other members.

MethodPathoperationIdSummary
GET/v1/space/membersmember_listThe agents in this space, with the app each last connected from. You are marked you: true.
PATCH/v1/space/members/{member_id}member_updateRename yourself (me); owners rename anyone and change roles.
DELETE/v1/space/members/{member_id}member_removeOwners remove a member; me leaves. Other keys keep working.
POST/v1/space/invitesinvite_createOwners: a one-time code and a prompt for the agent you invite.
GET/v1/space/invitesinvite_listOwners: open invites.
DELETE/v1/space/invites/{invite_id}invite_revokeOwners: revoke an open invite.
POST/v1/invites/acceptinvite_acceptJoin with a code and get your own key. No auth. Rate limited per IP.

Context and batch

MethodPathoperationIdSummary
GET/v1/contextcontext_getEverything an agent needs at the start of a run, in one call.
POST/v1/batchbatch_applyApply up to 50 writes atomically.

Memories

MethodPathoperationIdSummary
POST/v1/memoriesmemory_rememberRemember a fact. Identical facts are returned, not duplicated.
GET/v1/memoriesmemory_recallRecall by words (q), subject, tier, tag, author, or pinned. Without q, lists every fact with total and next_cursor.
GET/v1/memories/{id}memory_getGet one fact.
PATCH/v1/memories/{id}memory_updateChange a fact.
DELETE/v1/memories/{id}memory_deleteDelete one fact.
POST/v1/memories/importmemory_importImport up to 500 facts at once, as facts or as text with one fact per line. Facts already stored are skipped.
POST/v1/memories/extractmemory_extract_jobRemember from a conversation: get a job for your model.
POST/v1/memories/extract/resultmemory_extract_submitStore the facts your model extracted, in one transaction.
POST/v1/forgetmemory_forgetRemove matching facts, records, journal text, actions, KV values, and events. Supports dry_run.

Journal

MethodPathoperationIdSummary
PUT/v1/journal/{date}journal_putWrite the entry for a date (YYYY-MM-DD). merge: true appends.
GET/v1/journaljournal_listList entries newest first (from, to, kind, limit).

Records

MethodPathoperationIdSummary
POST/v1/collections/{collection}/recordsrecord_putCreate a record, or update the one with the same key, keeping fields you leave out.
GET/v1/collections/{collection}/recordsrecord_queryQuery by status, key, due_before. Page with cursor.
GET/v1/collections/{collection}/records/{id}record_getGet one record.
PATCH/v1/collections/{collection}/records/{id}record_updateUpdate with shallow merge and optional expected_version.
DELETE/v1/collections/{collection}/records/{id}record_deleteDelete a record.

Actions

MethodPathoperationIdSummary
POST/v1/actionsaction_proposePropose an action that needs approval. Returns a short id (A1).
GET/v1/actionsaction_listList actions, newest first. Default: open ones.
GET/v1/actions/{id}action_getGet one action.
PATCH/v1/actions/{id}action_updateMerge into an action's meta. Nothing else can be changed.
POST/v1/actions/{id}/transitionaction_transitionCompare-and-set status change (from, to, optional receipt).

KV and events

MethodPathoperationIdSummary
GET/v1/kv/{ns}kv_listList keys in a namespace.
GET/v1/kv/{ns}/{key}kv_getGet one value.
PUT/v1/kv/{ns}/{key}kv_setSet a value. Optional compare-and-set with expected_version.
DELETE/v1/kv/{ns}/{key}kv_deleteDelete a value.
POST/v1/eventsevent_appendAppend to the capped event log.
GET/v1/eventsevent_listList events newest first (kind, since, before_id).
GET/v1/activityactivity_listWho did what, newest first, by id only (member, op, since, before_id). Kept 30 days.

Dreaming

MethodPathoperationIdSummary
POST/v1/dreamdream_startStart a dream now (optional mode).
GET/v1/dream/runsdream_runsList recent runs and their reports.
POST/v1/dream/runs/{id}/undodream_undoUndo every change a run made (within 7 days).
GET/v1/dream/jobs/nextdream_job_nextClient mode: get the waiting job (start_if_due=true to start one).
POST/v1/dream/jobs/{id}/resultdream_job_submitClient mode: submit your model's JSON result.

Service endpoints

These are not part of the OpenAPI document:

MethodPathPurpose
GET/Service name, version, and links.
GET/health{"ok": true}
GET/openapi.jsonThe OpenAPI 3.0.3 document.
GET/docsRedirects to this page.
POST/mcpThe MCP endpoint (Streamable HTTP). On https://mcp.memlane.sh it is served at the root. Four tools are listed by default, twelve with ?tools=chat (for chat apps), and all 43 with ?tools=all. See MCP tools.

Conventions

  • Request and response bodies are JSON. Times are ISO 8601 with an offset (2026-11-05T09:00:00Z). Dates are YYYY-MM-DD.
  • Creates return 201. Idempotent repeats (same fact, same record key, same action key) return 200 with "created": false.
  • Errors are {"error": {"code", "message", "details"?}}. Status codes are listed in Concepts.
  • Ids are prefixed: sp_ (space), mem_ (memory), rec_ (record), dr_ (dream run). Actions use short ids per space (A1).
  • Browsers can only call the API from https://memlane.sh (for the playground on these pages) and from localhost. Call it from your server or agent everywhere else, so your key stays out of web pages.