HTTP endpoints exposed by the Premortem API worker: use the same routes from /app BFF proxies locally.
Who this is forDevelopers integrating audits, workspace settings, or issue actions.
Authentication
- Browser: Supabase session cookie on BFF routes (/api/* on web).
- Direct API worker: Bearer token or internal service auth in production.
- Local verification: PREMORTEM_AUTH_DISABLED=1 with local verification org/project IDs.
Submit audit (BFF)curl -sS -X POST http://127.0.0.1:13000/api/audits \
-H "Content-Type: application/json" \
-d '{"projectId":"<uuid>","branch":"main"}'
Audits
- POST /api/audits · submit audit (202 queued). Body: projectId, branch, commitSha?.
- GET /api/audits/:id · snapshot with runStatus, agentRuns, findings, graph, events.
- GET /api/audits/:id/graph · graph snapshot for Workflow Canvas.
- POST /api/audits/:id/pause · POST /api/audits/:id/resume · POST /api/audits/:id/cancel.
- GET /api/audits?limit=12 · recent runs with reviewable/rejected counts.
Poll audit snapshotcurl -sS http://127.0.0.1:13000/api/audits/<auditId> | jq .runStatus,.findings
Workspace
- GET /api/workspace · org, billing, usage, runtime, integrations bundle.
- PATCH /api/workspace/runtime · continuousAuditEnabled boolean (OFF = no automatic audits).
- POST /api/workspace/runtime/stop-all · disable continuous audit and cancel active runs.
- PATCH /api/workspace/llm · /work-item-attributes · /policies · /notifications.
- POST /api/projects · register repository resource.
Issues
- POST /api/audits/:id/issues/:issueId/action · confirm, dismiss, or stage.
- POST /api/audits/:id/issues/:issueId/edit · persist synthesis edits.
- POST /api/issues/:issueId/publish · create GitLab issue after approval.
- POST /api/issues/reconcile · org-wide reconciliation sweep.
- GET /api/reconciliation · recent drift/match events.
Error codes
- 402 quota_exceeded: monthly audit limit reached for plan.
- 403 feature_locked: GitLab publish allowance exceeded on Free tier.
- 403 repo_limit: max connected repositories for plan.
- 502 upstream: API worker unreachable from BFF or provider timeout.
View source on GitHub
Expected result
You can trigger audits and read snapshots without opening the UI.
Was this article helpful?