Complete API specifications for Agenstra's backend services. All specifications are available in OpenAPI 3.1.0 (for HTTP REST APIs) and AsyncAPI 3.0.0 (for WebSocket gateways) formats.
The Agent Controller provides a centralized control plane for managing multiple distributed agent-manager instances.
OpenAPI Specification: openapi.yaml
- View in Swagger Editor: Open in Swagger Editor
- Download: openapi.yaml
Canonical source in the monorepo: libs/domains/agenstra/backend/feature-agent-controller/spec/openapi.yaml
The Agent Controller HTTP API provides:
- Client management (CRUD operations) and client user management (Keycloak/users modes)
- Users authentication endpoints (
/auth/*,/users/*) whenAUTHENTICATION_METHOD=users - Tickets, comments, activity, migration, automation, and assisted body-generation flows (
/tickets/*) - Knowledge tree and relations (
/knowledge/*) for workspace pages/folders - Usage statistics (
/clients/:id/statistics/*,/statistics/*) - Global message filter rules for administrators (
/filter-rules) - Atlassian site connections and import configurations for administrators (
/imports/atlassian/*) - Agent autonomy configuration per workspace and per agent
- Proxied agent operations (CRUD, models, start/stop/restart, environment variables, deployments)
- Proxied file operations (read, write, create, delete, move)
- Proxied version control operations (including workspace prepare-clean and automation verify-commands)
- Server provisioning (Hetzner Cloud, DigitalOcean)
| Method | Path | operationId |
|---|---|---|
| GET | /knowledge |
listKnowledgeNodes |
| GET | /knowledge/tree |
getKnowledgeTree |
| GET | /knowledge/by-sha |
getKnowledgeNodeBySha |
| POST | /knowledge |
createKnowledgeNode |
| GET/PATCH/DELETE | /knowledge/{id} |
getKnowledgeNode / updateKnowledgeNode / deleteKnowledgeNode |
| GET | /knowledge/{id}/activity |
listKnowledgePageActivity |
| POST | /knowledge/{id}/reorder |
reorderKnowledgeNode |
| POST | /knowledge/{id}/duplicate |
duplicateKnowledgeNode |
| GET/POST | /knowledge/relations |
listKnowledgeRelations / createKnowledgeRelation |
| DELETE | /knowledge/relations/{id} |
deleteKnowledgeRelation |
| GET | /knowledge/relations/prompt-context |
getKnowledgePromptContext |
OpenAPI also documents composite surfaces without controllers in feature-agent-controller (auth/users from identity when bundled; admin webhooks; otel metrics). Those ops stay published. Cosmetic Nest {clientId} vs OpenAPI {id} param names are deferred.
AsyncAPI Specification: asyncapi.yaml
- View in AsyncAPI Studio: Open in AsyncAPI Studio
- Download: asyncapi.yaml
Canonical source in the monorepo: libs/domains/agenstra/backend/feature-agent-controller/spec/asyncapi.yaml
The Agent Controller WebSocket gateway provides:
clientsnamespace Client context (setClient),forwardto remote agent-managers, proxied events by name, reconnection notifications, controller-originated ticket hints for chatticketsnamespace Ticket board and automation realtime (setClient, upserts, comments, activity, run events,knowledgeRelationChanged)pagesnamespace Knowledge board realtime (setClient,knowledgeTreeChanged,knowledgeRelationChanged,knowledgePageActivityCreated)statusnamespace Per-user notification snapshots/patches (statusSnapshot,statusPatch,markEnvironmentRead,setActiveEnvironment,error)
The Agent Manager provides agent lifecycle management and container execution.
OpenAPI Specification: openapi.yaml
- View in Swagger Editor: Open in Swagger Editor
- Download: openapi.yaml
Canonical source in the monorepo: libs/domains/agenstra/backend/feature-agent-manager/spec/openapi.yaml
The Agent Manager HTTP API provides:
- Agent management (CRUD, models, start/stop/restart)
- Latest agent message metadata (
GET /agents/{id}/messages/latest-agent) for unread tracking - Per-agent regex filter rules (
/agents-filters) - Environment variable CRUD with container restart semantics
- Workspace configuration overrides (
/configuration-overrides) - File system operations (read, write, create, delete, move; optional
contextquery) - Version control operations (git status, branches, commit, push, pull, rebase, workspace prepare-clean, automation verify-commands)
- Deployment configuration and CI/CD run APIs (
/agents/:agentId/deployments/...) - Configuration endpoint (
/config)
GET /otel/metrics is documented for shared monitoring (outside Nest controllers in this feature). Nested Docker stats object fields in AsyncAPI remain underspecified placeholders.
AsyncAPI Specification: asyncapi.yaml
- View in AsyncAPI Studio: Open in AsyncAPI Studio
- Download: asyncapi.yaml
Canonical source in the monorepo: libs/domains/agenstra/backend/feature-agent-manager/spec/asyncapi.yaml
The Agent Manager WebSocket gateway provides:
- Agent authentication (
loginevent) - Real-time chat (
chat,chatMessage,chatEvent,enhanceChat,generateTicketBody, filter results) - File update notifications (
fileUpdate,fileUpdateNotification) - Git workspace change signal (
gitStateChanged) - Terminal session management (
createTerminal,terminalInput,terminalOutput,closeTerminal) - Container statistics broadcasting (
containerStats; default every 15s on the manager, configurable viaCONTAINER_STATS_SCHEDULER_INTERVAL)
Swagger Editor is an online tool for viewing and editing OpenAPI specifications. Use it to:
- Explore API endpoints interactively
- Generate client SDKs
- Validate API contracts
- Test API operations
AsyncAPI Studio is an online tool for viewing and editing AsyncAPI specifications. Use it to:
- Visualize WebSocket event flows
- Understand message schemas
- Generate documentation
- Validate AsyncAPI contracts
Pre-built client SDKs are automatically generated from the OpenAPI specifications and published to GitHub Packages. These clients provide type-safe, language-specific interfaces for interacting with the Agenstra APIs.
Generate locally with:
nx run agenstra-backend-agent-manager:openapi-client-js
nx run agenstra-backend-agent-controller:openapi-client-jsOutput lands under dist/clients/ (gitignored) and is published on release as:
Agent Manager Client: @forepath/agenstra-agent-manager-client
Agent Controller Client: @forepath/agenstra-agent-controller-client
The TypeScript clients are built with Axios and include full type definitions and interfaces. All clients support configurable base URLs for flexible endpoint configuration.
To install the published clients, configure your package manager to use GitHub Packages:
- npm/yarn: Configure
@forepathscope to use GitHub Packages registry in your.npmrc
All clients are automatically generated and published with each release, ensuring they stay in sync with the latest API specifications.
- Architecture Overview System architecture and component relationships
- WebSocket Communication Real-time communication patterns
- Backend Agent Controller Application Application details
- Backend Agent Manager Application Application details