API documentation

Verify AI-written reports. Over an API.

Everything the console does is available over REST with JSON bodies. Create an API key in the console (account menu, API keys; the secret is shown once). Authentication is a bearer token.

Live and self-serve. Sign in at app.portmem.com to create a key.
Base URL
https://portmem-api-140315397522.us-central1.run.app

Interactive reference at /docs, OpenAPI spec at /openapi.json.

1 · Upload a source document (yours, private by default)
curl -X POST "https://portmem-api-140315397522.us-central1.run.app/v1/ingest_file" \
  -H "Authorization: Bearer pmk_YOUR_KEY" \
  -F "file=@indenture.pdf" -F "source_id=indenture.pdf"
2 · Review a generated report against it (background job)
curl -X POST "https://portmem-api-140315397522.us-central1.run.app/v1/review/async" \
  -H "Authorization: Bearer pmk_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"document": "<the LLM-generated text>", "source": "indenture.pdf", "max_claims": 30}'

# poll until status is "done"; the result contains every claim + verdict
curl "https://portmem-api-140315397522.us-central1.run.app/v1/review/jobs/JOB_ID" -H "Authorization: Bearer pmk_YOUR_KEY"
3 · Sign off flagged claims, publish a verification page for recipients
curl -X POST "https://portmem-api-140315397522.us-central1.run.app/v1/decisions/REQUEST_ID/signoff" \
  -H "Authorization: Bearer pmk_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"claim": "<the flagged claim text>", "decision": "approved", "note": "checked s4.09"}'

curl -X POST "https://portmem-api-140315397522.us-central1.run.app/v1/decisions/REQUEST_ID/publish" \
  -H "Authorization: Bearer pmk_YOUR_KEY" -H "Content-Type: application/json" -d '{"publish": true}'

# what a recipient sees (no auth; 404 until published)
curl "https://portmem-api-140315397522.us-central1.run.app/v1/public/verification/REQUEST_ID"
Search the corpus (supporting endpoint)
curl -X POST "https://portmem-api-140315397522.us-central1.run.app/v1/retrieve" \
  -H "Authorization: Bearer pmk_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"query": "change of control provisions", "max_results": 5, "sources": ["indenture.pdf"]}'

Returns the passages that currently govern, with supersession handled; scope with sources.

Claude / MCP

A self-contained MCP bridge gives Claude Desktop, Claude Code, or any MCP client direct tools over your workspace (search, upload, reviews, sign-offs, publishing). Setup instructions live in the console under account menu, API keys.

The permanent record

Every review, sign-off, and publish lands in a hash-chained, Ed25519-signed, append-only ledger. Read records with GET /v1/decisions/REQUEST_ID; export evidence packets for your own archive.