Appearance
API Endpoints โ
Complete inventory of routes registered in dps-code-api/app.py. Auth legend: ๐ API key ยท ๐ค browser session ยท either. Full detail (bodies, responses, errors, side effects) is in the API reference.
Auth & session โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | / | โ | Liveness probe |
| GET | /auth/discord/login | โ | Begin Discord OAuth |
| GET | /auth/discord/callback | โ | OAuth callback |
| GET | /auth/me | ๐ค | Current agent + permissions |
| POST | /auth/logout | ๐ค | End session |
| POST | /demo/reset | ๐ค (demo) | Re-seed demo dataset |
Generators & utilities โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /generate/agreement | ๐ | AGM-##### |
| GET | /generate/agent | ๐ | DPS-AG-##### |
| GET | /generate/join | ๐ | SC-###X# |
| GET | /generate/case | ๐ | DPS-CASE-##### |
| GET | /generate/investigation | ๐ | INV-##### |
| GET | /generate/clearance | ๐ | CL-### |
| POST | /util/timestamp | ๐ | JS date โ Discord Unix timestamp |
Reports / dockets โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /reports/create | either | Create report (atomic, + event + queue) |
| GET | /reports | either | List (legacy or paginated rpc_list_reports) |
| GET | /reports/<report_id> | either | Full report |
| PATCH | /reports/<report_id>/update | either | Whitelisted update (status/assignment/โฆ) |
| DELETE | /reports/<report_id> | either | Hard delete (reason + forensic audit) |
| POST | /reports/<report_id>/action | either | validate / invalidate / investigate / contact_reporter / claim |
| POST | /reports/<report_id>/investigation/begin | either | Begin investigation (legacy adapter) |
| POST | /reports/<report_id>/investigation/end | either | Conclude investigation โ Pending |
| POST | /reports/<report_id>/viewed | either | No-op (compat) |
| POST | /reports/<report_id>/evidence/opened | either | No-op (compat) |
| POST | /reports/<report_id>/notes | either | Add note |
| POST | /reports/<report_id>/evidence | either | Add evidence |
| POST | /reports/<report_id>/timeline | either | Add timeline entry |
| POST | /reports/<report_id>/discord-profiles | ๐ | Store bot-captured profile snapshots |
Contact threads โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /reports/<report_id>/contact | either | Thread + closed state |
| POST | /reports/<report_id>/contact/reply | either | Agent message (queues bot DM) |
| POST | /reports/<report_id>/contact/close | either | End conversation |
| POST | /reports/<report_id>/contact/respond | ๐ | Bot relays reporter reply |
Evidence & audit โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /evidence | either | Global evidence list (enriched) |
| GET | /audit | either | Paginated audit log (rpc_audit_log_v2) |
Action queues โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /actions/pending | ๐ | Pending/processing actions |
| GET | /actions/next | ๐ | Atomic single pickup (204 when empty) |
| GET | /actions/next/operator | ๐ | Operator-queue pickup |
| GET | /actions/next/supervisor | ๐ | Supervisor-queue pickup |
| GET | /actions/pending/operator | either | Operator queue list |
| GET | /actions/pending/supervisor | either | Supervisor queue list (Senior Agent+) |
| POST | /actions/<action_id>/complete | ๐ | Record bot outcome (atomic + event) |
| POST | /actions/<action_id>/requeue | either | Failed โ pending |
Agents โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /agents | either | List agents |
| GET | /agents/<discord_id> | either | One agent |
| POST | /agents/create | either | Start onboarding record |
| PATCH | /agents/<discord_id>/update | either | Bot onboarding fields, or audited admin update (Director for rank/clearance) |
Punishments & discipline โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /punishments | ๐ค | Issue punishment (atomic + audit + delivery) |
| GET | /punishments | ๐ค | List (filters + pagination) |
| GET | /punishments/<punishment_id> | ๐ค | One punishment |
| PATCH | /punishments/<punishment_id> | ๐ค | Whitelisted edit (reason required) |
| POST | /punishments/<punishment_id>/revoke | ๐ค | Revoke (reason required) |
| GET | /punishments/users/<discord_id>/profile | ๐ค | Stored Discord profile snapshot |
| GET | /discipline/next | ๐ | Atomic delivery pickup (204 when empty) |
| GET | /discipline/pending | either | Delivery list |
| POST | /discipline/user-lookup | ๐ค | Enqueue profile lookup |
| POST | /discipline/<item_id>/complete | ๐ | Record delivery outcome |
| POST | /discipline/user-lookup/<item_id>/profile | ๐ | Deliver captured profile + complete |
| POST | /discipline/<item_id>/requeue | either | Failed โ pending |
System Administration โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /admin/health | ๐ค | 10-section health + incident history |
| GET | /admin/queue | ๐ค | All queue actions |
| POST | /admin/queue/<action_id>/requeue | ๐ค | Requeue failed (audited) |
| POST | /admin/queue/<action_id>/cancel | ๐ค | Cancel (audited) |
| POST | /admin/queue/sweep | ๐ค | Manual stale sweep (audited) |
| GET | /admin/audit | ๐ค | Admin audit trail |
| GET | /admin/agents | ๐ค | Full agent list |
| PATCH | /admin/agents/<discord_id> | ๐ค | Audited agent correction |
| GET | /admin/access | ๐ค | Allowlist (Director) |
| POST | /admin/access/grant | ๐ค | Grant access (Director) |
| POST | /admin/access/revoke | ๐ค | Soft revoke (Director) |
| POST | /admin/access/remove | ๐ค | Hard remove (Director) |
| GET | /admin/reports | ๐ค | Report search (Director) |
| POST | /admin/reports/<report_id>/correct | ๐ค | Record correction (Director) |
| GET | /admin/schema | ๐ค | Migrations + RPC inventory (Director) |
| POST | /admin/schema/reload | ๐ค | PostgREST reload (Director) |
Training Center โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /training/me | ๐ค | Role discovery |
| GET | /training/realtime-config | ๐ค | Supabase URL + anon key + token path |
| GET | /training/realtime-token | ๐ค | Short-lived Realtime JWT |
| GET | /training/scenarios | ๐ค (trainer) | Scenario catalog |
| GET | /training/trainees | ๐ค (trainer) | Onboarding agents |
| GET | /training/sessions | ๐ค | Role-scoped session list |
| POST | /training/sessions | ๐ค (trainer) | Create session |
| GET | /training/sessions/<session_id> | ๐ค | Full session payload |
| POST | /training/sessions/<session_id>/start | ๐ค (owner trainer) | pending โ active |
| POST | /training/sessions/<session_id>/pause | ๐ค (owner trainer) | active โ paused |
| POST | /training/sessions/<session_id>/resume | ๐ค (owner trainer) | paused โ active |
| POST | /training/sessions/<session_id>/restart | ๐ค (owner trainer) | fresh active run |
| POST | /training/sessions/<session_id>/reset | ๐ค (owner trainer) | back to pending |
| POST | /training/sessions/<session_id>/end | ๐ค (owner trainer) | โ completed |
| POST | /training/sessions/<session_id>/abort | ๐ค (owner trainer) | โ aborted |
| POST | /training/sessions/<session_id>/events | ๐ค (participant) | Record trainee action (+ engine) |
| POST | /training/sessions/<session_id>/scenarios/<scenario_id>/activate | ๐ค (owner trainer) | Introduce scenario |
| POST | /training/sessions/<session_id>/evidence/<key>/release | ๐ค (owner trainer) | Evidence override |
| POST | /training/sessions/<session_id>/evidence/<key>/lock | ๐ค (owner trainer) | Evidence override |
| POST | /training/sessions/<session_id>/objectives/<id>/complete | ๐ค (owner trainer) | Objective override |
| POST | /training/sessions/<session_id>/objectives/<id>/reset | ๐ค (owner trainer) | Objective override |
| POST | /training/sessions/<session_id>/inject | ๐ค (owner trainer) | Information injection |
| POST | /training/sessions/<session_id>/notes | ๐ค (participant) | Trainer/trainee note |
| POST | /training/sessions/<session_id>/notes/<note_id>/release | ๐ค (owner trainer) | Release private note |
| POST | /training/sessions/<session_id>/evaluate | ๐ค (owner trainer) | Grade + complete |
ER:LC โ
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /erlc/player/<roblox_id> | ๐ | ER:LC player lookup via relay |