API
The API is FastAPI with an OpenAPI document at /api/openapi.json and interactive docs at /api/docs
(http://127.0.0.1:8710/api/docs locally). The web app's TypeScript types are generated from that document
(make openapi). backend/openapi.json is the committed copy.
Authentication
POST /api/auth/loginwith{"email", "password"}sets an HttpOnly session cookie and returns a bearer token.- Browsers use the cookie; state-changing requests must also send
X-Mendora-Client: web. - CLIs send
Authorization: Bearer <token>. GET /api/auth/me,POST /api/auth/logout.
Areas
| Prefix | Who | Highlights |
|---|---|---|
/api/public | anyone | status, overview, rounds, rounds/{id} (published only), disclosed cases, trace, evidence, explorer, config, practice, templates |
/api/miner | miner | overview, submissions (multipart upload: archive, envelope), submissions/{id}, register-hotkey (demo) |
/api/operator | operator | overview, jobs (+ retry), rounds (open, freeze, publish, detail), calibration, disputes, attestations, releases, chain (+ dry run), audit, similarity review |
/api/customer | customer admin or reviewer, tenant-scoped | overview, jobs (+ state=needs_review), jobs/{id} (inspector data), jobs (start a demo job), jobs/{id}/actions |
/api/validator | signature-authenticated | attestations |
/api/health, /api/metrics | operations | liveness with database check; Prometheus text |
Lists are paginated with page and page_size (at most 100) and return {items, page, page_size, total}.
Errors
Errors are {"detail": {"code": "...", "message": "..."}} with stable codes, for example not_signed_in (401),
forbidden and csrf_header_missing (403), not_found (404: also used for other tenants' jobs), round_state and
wrong_state (409), invalid_request (422), and intake codes such as path_traversal, link_in_archive,
archive_too_large, duplicate_package, one_per_hotkey, bad_envelope (422, with the list of checks).
Unexpected errors return internal_error with a request_id that appears in the server log.