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/agentsMCP 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.
Authentication
JWT tokens, API keys, and auth flows
Agents API
Agent lifecycle, configuration, credentials, and sharing
Chat API
Chat, voice, streaming, public and paid chat endpoints
Skills API
Skills library, sources, and agent skill assignments
Schedules & Triggers API
Cron schedules, webhook triggers, and event-driven execution
Webhook Triggers
Internal triggers, event webhooks, and external integrations
Key Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/token | Authenticate and get JWT token |
| POST | /api/mcp/keys | Create MCP API key |
| GET | /api/agents | List all agents |
| POST | /api/agents | Create a new agent |
| POST | /api/agents/:name/start | Start an agent container |
| DELETE | /api/agents/:name | Delete an agent and all resources |
| POST | /api/agents/:name/chat | Send message to agent (streaming) |
| POST | /api/agents/:name/task | Submit async task to agent |
| GET | /api/skills/library | List all skills in the library |
| PUT | /api/agents/:name/skills | Bulk update agent skill assignments |
| POST | /api/agents/:name/schedules | Create a cron schedule for an agent |
| POST | /api/agents/:name/schedules/:id/trigger | Manually trigger a schedule execution |
| POST | /api/events | Emit event (triggers subscriptions) |
| POST | /api/agents/:name/credentials/inject | Inject credentials into a running agent |