Skip to content

API

Part of Dev. The server is built with Axum and listens on port 8080. Routes are declared in the binary and in feature crates; the long table of methods and paths is generated, not maintained by hand.

Where routes are declared

Source What it contributes
botserver/src/main_module/routes/api_setup.rs setup_api_routes() mounts liveness, product, appearance, settings, manifest, advisories and the authenticated /api/auth nest.
botserver/src/main_module/routes/ 129 route modules and folders, including ai_accounts/, chat_history/, drive_sync/ and feature_routers/.
botserver/crates/*/src/ Crate-owned routers; for example botcanvas mounts a WebSocket route and botsheet mounts its own.
botserver/src/core/bot/api_catalog/ and endpoint_inventory*.rs The intentional catalog and inventory that the generator merges with .route("…") literals.

Verified examples

Method and path Where it is established
GET /health botserver/src/main_module/routes/api_setup.rs
GET /api/health ApiUrls::HEALTH in botserver/crates/botcore/src/urls/mod.rs, mounted in api_setup.rs
GET /api/product botserver/src/main_module/routes/api_setup.rs
GET /api/apps/catalog botserver/src/apps/mod.rs; listed in the generated apps family
GET /ws/:param botserver/src/main_module/routes/api_setup.rs; listed in the generated WebSocket family
GET /ws/canvas/:param botserver/crates/botcanvas/src/lib.rs; listed in the generated WebSocket family

These examples are entry points for navigation. The generated REST reference and its family pages carry the full method/path table with a schema not modeled marker where a handler has no typed schema. The network contract states the base URL; API examples show hand-written usage.

Rules for a new route

  1. Mount it in the owning module: a binary route in main_module/routes/, or a router inside the feature crate.
  2. Add a catalog entry only when the route is meant to be an API command; the Inventory column in the generated reference records that distinction.
  3. Regenerate the reference and run its --check guard. Never edit a generated family page to make a route appear.

For agent routes, start from the generated agent family. Next: Agents.