SpaceBot API
The stable external API lives under /api/v1/* and uses Authorization: Bearer sb_live_... API keys.
The machine-readable OpenAPI document is available at /api/openapi.json and can be regenerated into docs/generated/openapi.json with:
bun run docs:api
Error Shape
Errors return JSON with a top-level error string. Rate-limited requests return HTTP 429 with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
Endpoints
GET /api/v1/stats?days=30requiresstats:read.GET /api/v1/settingsrequiressettings:read.GET /api/v1/commandsrequirescommands:read.GET /api/v1/automationsrequiresautomations:read.GET /api/v1/integrations/statusreads integration status.GET /api/stats/:guildId/export?format=json|csvexports admin-authenticated report data.
Integrations
Discord signed interactions at /api/discord/interactions are signature-verified and exempt from app rate limits. Runner WebSocket upgrade paths are also exempt.