Skip to main content
Trinity

API Reference

Trinity exposes a comprehensive REST API across 40+ routers; the pages below document 130+ endpoints. The full interactive documentation is available at http://localhost:8000/docs when running locally.

Authentication

# Get a JWT token
curl -s -X POST http://localhost:8000/api/token \
  -d 'username=admin&password=${ADMIN_PASSWORD}'

# Use in requests
curl -s -H "Authorization: Bearer <token>" \
  http://localhost:8000/api/agents

MCP API keys (trinity_mcp_*) work as Bearer tokens too and carry a scope that bounds what they can reach. Under two-factor authentication a correct password answers 403 mfa_required with no session, so for automation prefer an MCP key — see Authentication.

Key Endpoints

MethodEndpointDescription
POST/api/tokenAuthenticate and get JWT token
POST/api/mcp/keysCreate MCP API key
GET/api/agentsList all agents
POST/api/agentsCreate a new agent
POST/api/agents/:name/startStart an agent container
DELETE/api/agents/:nameDelete an agent and all resources
POST/api/agents/:name/chatSend message to agent (streaming)
POST/api/agents/:name/taskSubmit async task to agent
GET/api/skills/libraryList all skills in the library
PUT/api/agents/:name/skillsBulk update agent skill assignments
POST/api/agents/:name/schedulesCreate a cron schedule for an agent
POST/api/agents/:name/schedules/:id/triggerManually trigger a schedule execution
POST/api/eventsEmit event (triggers subscriptions)
POST/api/agents/:name/credentials/injectInject credentials into a running agent