API Reference

Context, import and capture

Build a context pack, import a history, send hook payloads to the inbox and review captures.

API Reference6 pages

POST /api/context

Builds a prompt-ready pack. Accepts a session cookie or an MCP token, which is what the Claude Code SessionStart hook uses.

request
curl -X POST https://memo.uno/api/context \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer memo_..." \
  -d '{"preset":"coding","repo":"acme/api","path":"lib","task":"refactor auth"}'
preset
Notes
chat (~1,200 chars), coding (~1,600), full (~2,800). Defaults to chat.
repo
Notes
Repository as owner/name; includes its code memory.
path
Notes
File or directory used for ranking.
task
Notes
Short description; matching memories move up.
response
{ "text": "# Memory for you · acme/api\n\n…", "sections": [ … ], "preset": "coding" }

POST /api/import

Parses a ChatGPT or Claude export, or pasted text, and returns candidates without saving them. Requires a session.

request
curl -X POST https://memo.uno/api/import \
  -H "Content-Type: application/json" \
  --cookie "memo_session=<session>" \
  -d '{"data":{"conversations":[…]}}'
  • data accepts the parsed export; text accepts plain text.
  • Only user messages are read; assistant output is discarded.
  • Candidates carry a duplicate flag when they are close to existing memory.
  • Nothing is written until you select candidates and save them from the dashboard.

POST /api/ingest

Accepts a git commit or a conversation payload and queues the extracted memories as pending. This is what the capture hooks call. It accepts a session or a bearer token.

commit payload
curl -X POST https://memo.uno/api/ingest \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer memo_..." \
  -d '{
    "source": "git-hook",
    "repo": "acme/api",
    "branch": "main",
    "commit_sha": "…",
    "message": "fix: retry embeddings on timeout",
    "files": ["lib/server/embed.ts"],
    "diff": "…"
  }'
conversation payload
{
  "source": "claude-code",
  "session_id": "…",
  "repo": "acme/api",
  "messages": ["I always deploy from main.", "Never force-push."]
}

The response reports how many captures were created and what was extracted.

Inbox

GET
Path
/api/inbox
Purpose
List pending captures; ?count=1 returns just the total
PATCH
Path
/api/inbox/:id
Purpose
Approve or reject one capture, optionally editing it first
POST
Path
/api/inbox
Purpose
Bulk decision: { "action": "approve" | "reject", "items": [ … ] }
Approval is a write

Approving a capture runs it through the same resolver as a manual write, so an approved duplicate merges instead of creating a second row.