TraderMemos
Guides

API tokens & OpenAPI

Personal access tokens (tm_pat_…) for MCP, AI agents, and scripts, plus the interactive OpenAPI reference at /docs.

Everything the web app does goes through the JSON API — and you can call it yourself. Personal access tokens (PATs) give scripts, MCP servers, and AI agents long-lived access without juggling login/refresh flows.

Create a token

Settings → API → Access tokens → Generate token. Pick a name (e.g. MCP bot, scripts) and an expiration: never, 30 days, 90 days, or 1 year.

The full secret — tm_pat_… — is shown once. Store it now; afterwards the UI only shows the first characters, plus created / expires / last-used times. Revoking a token cuts off its clients immediately.

A token has the same access as your account — there are no scopes. Treat it like your password, and prefer an expiry over "never" for anything you might forget about.

Use it

Send it as a Bearer token on any /api/v1 route:

curl -H "Authorization: Bearer tm_pat_…" https://your-host/api/v1/accounts
# add a fill (idempotent — same fill twice is deduplicated)
curl -X POST https://your-host/api/v1/executions \
  -H "Authorization: Bearer tm_pat_…" -H "Content-Type: application/json" \
  -d '{"account_id":"…","symbol":"NVDA","side":"buy","quantity":100,"price":190.5,"executed_at":"2026-08-01T14:32:05Z"}'

Useful surfaces: /trades, /executions, /imports, /exports?format=json|csv|zip, /analytics/summary, /setups, /notes, /cash-transactions.

OpenAPI reference

The full reference is published on this site — API Reference — one page per tag, with request and response schemas, code samples, and a playground you can point at your own server.

The same reference (Scalar) also ships with every instance:

SetupDocs URL
Docker all-in-onehttp://localhost:3000/docs
API directlyhttp://localhost:8080/docs
Split API hosthttps://api.example.com/docs

The raw spec is at /openapi.yaml on the same host — feed it to codegen or an LLM. Both routes are unauthenticated (they describe the API, they don't expose data); actual API calls still require auth. GET /healthz is also public and returns the running version.

MCP / AI agents

Point any HTTP-capable MCP server or agent at your instance with the PAT as a Bearer header and /openapi.yaml as the tool description. Everything the UI can do — importing fills, querying analytics, annotating trades — is scriptable.

On this page