https://convex.memorycrystal.ai as the hosted base URL. Send a Bearer API key and Content-Type: application/json for JSON requests. Account ownership comes from authentication, not a request-body userId.
Start with authentication. Separate references cover knowledge bases, assets, research, and MCP setup. HTTP JSON below describes the handlers; hosted and stdio MCP may reshape it.
Endpoint map
Paths in this table are relative to/api/mcp.
Retrieval
memoryId and ranking metadata. Read retrieval and diagnostics for returned counts, message scan coverage, filters, and timing; there is no supported debugRecallOutput=true query switch. The recall page explains bounded and degraded retrieval.
Transcript search is lexical, not vector search. Recent messages default to chronological order; order: "newest" is supported. Message records use content, not a universal text field, and grouped turns are separate. For search, follow pagination.nextOffset while hasMore is true within the offset bound. The HTTP window fields are fromMs and toMs.
Use scopeToSession: true with a sessionKey when you want session-restricted durable recall. Omitting scope does not expose all private transcripts. IDs hidden by visibility checks return 404.
Writes and continuity
/capture for a durable memory. It schedules embedding/salience work; it does not return an embedding vector or creation metadata as a universal response.
Update corrects a record in place. Supersede atomically archives and links a predecessor to its successor. scopeChannel authorizes the old scope; channel changes stored scope. Both reject protected placeholder writes with 409 redacted_content_write unless deliberately overridden.
Checkpoint creation requires an explicit user request. Its result contains ok, id, checkpointId, memoryCount, allowance, retainedCount, snapshotCap, snapshotByteLimit, and tier. It is a bounded backup, not a full export.
Trace returns a source snapshot with messages, messageCount, omittedCount, createdAt, and reason. Above 20 messages, it returns the first ten and last ten. An unavailable snapshot is null with a reason; it is not a complete transcript guarantee.
Completed turns and sessions
/turn requires sessionKey, channel, turnId, and nonempty assistantMessage; send userMessage when available. Optional platform, agent, metadata, and project/repository fields preserve attribution. Retrying the same account/turn ID is idempotent. No embedding or durable extraction runs in the turn request; distillation is separate.
/session accepts recentLimit (default 12, clamped 1–50; limit is an alias) and optional sinceMs. It returns a summary plus the selected recent messages and grouped turns.
Export
GET/api/memories exports the authenticated owner’s active memories, newest first. It is an owner export, not a scoped recall endpoint.
The response is
memories plus pagination containing pageSize, cursor, and isDone. Continue until isDone; preserve the same filters across pages.
Raw messages remain until deletion on every tier. See rate limits for route-specific responses and errors for validation and visibility failures.
Request and response examples
The following examples show raw HTTP JSON. Replace placeholder IDs and scope values with your own returned values. Larger response examples show selected fields; the endpoint map lists the additional envelope fields.POST /api/mcp/recall
Request body:POST /api/mcp/capture
Request body:POST /api/mcp/search-messages
Request body:POST /api/mcp/turn
Request body:POST /api/mcp/recent-messages
Request body:Full-turn workflow
- Call
/wakeat session start if you need an opening briefing. - Call
/recallwith the current question and intended scope; query named KBs separately. - After the assistant completes a response, send the transcript pair to
/turnusing a stable turn ID. - Save an explicit durable outcome through
/capturewhen needed. Do not equate this with transcript capture. - Create a checkpoint only when the user requests a backup.
Errors and common mistakes
On reads, check both HTTP status and retrieval diagnostics. On writes, save the returned ID before looking for the record through recall. Do not blindly retry a durable capture after a timeout: it is not the idempotent completed-turn endpoint. Investigate whether it was saved first. For ID-based reads or writes, preserve the relevant identity and visibility scope. UsescopeChannel on update/supersede to authorize the existing record without moving it; use channel only for an intended move. A 404 can conceal a scope mismatch. Follow Retry-After handling on 429 responses.