API Documentation
This directory contains all API-related documentation for the Flowbot project.
File Descriptions
swagger.json & swagger.yaml
- OpenAPI specification files
- Contains complete API interface definitions
- Auto-generated by
swaggo/swag
docs.go
- Auto-generated Go code with embedded Swagger definitions
- Provides Swagger UI at runtime
api.http
- HTTP request examples collection
- Can be run directly in VS Code REST Client or IntelliJ HTTP Client
Usage
View API Documentation
After starting the server, visit: http://localhost:6060/swagger/index.html
Generate/Update API Documentation
# Via task runner
task swagger
# Or directly
go tool swag init -g cmd/main.go -o ./docs/api
go tool swag fmt -g cmd/main.go
API Overview
Base URL (Business Routes)
Business routes are mounted under:
http://localhost:6060/service
Top-level routes (health, metrics, oauth, hub management, webhook, form, agent, platform, pages) are registered at the root:
http://localhost:6060
Authentication
API requests require an X-AccessToken header:
X-AccessToken: <your-token>
Main API Modules
| Module |
Description |
hub |
Hub management - app lifecycle, capabilities, health |
notify |
Multi-channel notification management (Slack, Pushover, ...) |
server |
Server management (stacktrace, uploads) |
workflow |
Workflow management |
Additionally, modules like bookmark, kanban, reader are defined as abilities in the capability layer and mounted dynamically.
Server Routes
| Route |
Method |
Description |
/livez |
GET |
Liveness probe |
/readyz |
GET |
Readiness probe |
/startupz |
GET |
Startup probe |
/metrics |
GET |
Prometheus metrics |
/oauth/:provider/:flag |
ALL |
OAuth callbacks |
| POST /webhook/provider/* |
POST |
Provider webhook handler |
/platform/:platform |
ALL |
Platform callbacks |
/form |
POST |
Form submissions |
/p/:id |
GET |
Page rendering |
/agent |
POST |
Agent data endpoint |
| GET /page/:id/:flag |
GET |
Dynamic page rendering |
/hub/apps* |
GET/POST |
Hub management REST API |
/hub/capabilities* |
GET |
Capability listing |
/hub/health |
GET |
Hub health check |
Bot Webservice Routes
Each module can register webservice routes via the module handler interface. These are mounted dynamically at runtime.