api

package
v0.92.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

README

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.

Documentation

Overview

Package api Code generated by swaggo/swag. DO NOT EDIT

Index

Constants

This section is empty.

Variables

View Source
var SwaggerInfo = &swag.Spec{
	Version:          "1.0",
	Host:             "localhost:6060",
	BasePath:         "/service",
	Schemes:          []string{"http"},
	Title:            "Flowbot API",
	Description:      "Flowbot Chatbot API",
	InfoInstanceName: "swagger",
	SwaggerTemplate:  docTemplate,
	LeftDelim:        "{{",
	RightDelim:       "}}",
}

SwaggerInfo holds exported Swagger Info so clients can modify it

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL