api

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 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 (mounted under /hub/*)
web Web UI and admin pages - agent sessions, agent skills, dashboards (mounted under /, /agent-sessions/*, /agent-skills/*)
example Reference module demonstrating the module framework

Business capabilities (notify, bookmark, kanban, reader, memo, note, forge, github) are implemented as abilities in pkg/ability/ and mounted dynamically via each module's webservice rules.

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 (access token or x-signature / ?sig=)
/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

Form POST requires either a valid access token (with scopes) or the form signature issued at create time (Extra.signature, also embedded as ?sig= on the form link / x-signature field).

Provider webhooks under /webhook/provider/* reject deliveries when the provider webhook secret/token is not configured (including Memos vendors.memos.webhook_token). Tailchat inbound callbacks require platform.tailchat.webhook_token and header X-Tailchat-Token.

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