src/main.py mounts routers under the /api/v1 prefix unless a route documents otherwise.

Domains and modules

Domainsrc/apis/ modulesTypical concerns
Auth and identityauth, users, organizationsToken validation, org membership
Messagingmessages, conversations, channels, websocketREST and real-time messaging
Tasks and worktasks, dashboard, attendance, workdays, scheduled_messages, task_dependencies, message_dependencies, unread_countsLearner workflows, delayed execution, and dependency-aware task orchestration
Simulationsimulation_admin, characters, agents, quick_help, heartbeat, business_hoursSettings, characters, voice sessions, heartbeat processing, and lifecycle windows
AI usage and pricingai_usageOrg pricing CRUD, usage summaries, trends, platform rollups
Operationsanalytics, revenue, system_health, audit_logs, admin_overview, autogen_logs, token_usage, admin_fixPlatform visibility, runtime diagnostics, and remediation utilities
OnboardingonboardingExtended onboarding profile and setup flows

OpenAPI quality

The docs API reference tab uses the public OpenAPI bundle (docs/api-reference/openapi.public.json); the repository also keeps a full export (openapi.json). When you add or change routes:
  • Set tags on APIRouter or individual operations so the explorer groups endpoints logically.
  • Add summary and description for anything external or partner-facing.
Regenerate after backend changes:
uv run python scripts/dev/export_openapi_for_docs.py
Run from the repository root.

WebSockets

Real-time features (for example typing indicators or notifications) use handlers such as src/apis/websocket.py. Coordinate payload changes with frontend callers and any contract tests. For detailed AI accounting endpoint behavior, see AI usage and cost tracking.