API Reference
All endpoints are available at https://app.fleetrun.app. Authenticate with a Bearer token from Settings → API Tokens.
Authentication
Include your token in the Authorization header:
Authorization: Bearer fr_live_xxxxxxxxxxxxxxxxxxxxTokens are org-scoped. All requests are rate-limited to 120 requests/minute per token.
Endpoints
/api/agents/api/agents/api/agents/[id]/api/agents/[id]/api/agents/[id]/api/tasks/api/tasks/api/tasks/[id]/api/tasks/[id]/api/run/api/messages/api/secrets/api/secrets/api/secrets/api/mcps/api/mcps/api/usage/api/meDetailed reference
/api/agentsList all agents in the org.
Returns
Array of Agent objects.
/api/agentsCreate a new agent.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Display name. |
role | string | yes | System prompt / role description. |
model | string | yes | Model ID (e.g. claude-sonnet-4-5). |
provider | string | yes | Provider key (anthropic | openai | openrouter). |
glyph | string | yes | Single emoji used as the agent avatar. |
manager | string | no | Agent ID of this agent's supervisor. |
team | string | no | Team name to assign the agent to. |
Returns
Created Agent object.
/api/agents/[id]Get a single agent by ID.
Returns
Agent object.
/api/agents/[id]Update agent fields (name, role, model, status, etc.).
Returns
Updated Agent object.
/api/agents/[id]Archive an agent (soft delete).
Returns
{ ok: true }
/api/tasksList tasks. Supports filtering by status and assignee.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
status | string | no | Filter by status (pending | running | done | error | waiting). |
assignee | string | no | Filter by agent ID. |
Returns
Array of Task objects, most recent first.
/api/tasksCreate a new task.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | yes | Short label for the task. |
input | string | yes | Full prompt / payload sent to the agent. |
assignee | string | yes | Agent ID to assign the task to. |
requester | string | no | Agent ID that created the task. |
priority | string | no | low | normal | high. Defaults to normal. |
epic_id | string | no | Associate with an epic. |
Returns
Created Task object.
/api/tasks/[id]Get a single task by ID.
Returns
Task object with full log history.
/api/tasks/[id]Update task fields (status, priority, assignee).
Returns
Updated Task object.
/api/runExecute a task. Returns a Server-Sent Events stream of execution events.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
taskId | string | yes | ID of the task to run. |
Returns
SSE stream. Events: { type, text } — types include thinking, tool_call, tool_result, output, error.
/api/messagesList messages on the bus. Supports filtering by agent, type, and time range.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
agent | string | no | Filter by agent ID (sender or receiver). |
type | string | no | Filter by message type. |
limit | number | no | Max results. Default 100, max 500. |
Returns
Array of Message objects.
/api/secretsList secret keys (values are never returned).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
scope | string | no | org | agent. Defaults to org. |
agent | string | no | Agent ID for agent-scoped secrets. |
Returns
Array of { key, scope, agentId, updatedAt }.
/api/secretsCreate or update a secret.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
key | string | yes | Secret key name (uppercase, underscores). |
value | string | yes | Secret value — encrypted at rest. |
scope | string | no | org | agent. Defaults to org. |
agentId | string | no | Required for agent-scoped secrets. |
Returns
{ ok: true }
/api/secretsDelete a secret by key and scope.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
key | string | yes | Secret key to delete. |
scope | string | no | org | agent. |
Returns
{ ok: true }
/api/mcpsList all configured MCP servers.
Returns
Array of MCP server objects.
/api/mcpsAdd a new MCP server.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Unique name for this MCP server. |
transport | string | yes | stdio | http. |
command | string | no | Executable for stdio transport. |
args | string[] | no | Arguments for the command. |
url | string | no | URL for http transport. |
env | object | no | Environment variables (can reference secrets). |
Returns
Created MCP server object.
/api/usageGet token usage and task counts for the org, optionally broken down by agent or model.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
period | string | no | day | week | month. Defaults to month. |
agent | string | no | Filter to a specific agent. |
Returns
Usage summary: { total_tokens, task_count, by_agent, by_model, daily_breakdown }.
/api/meReturn the authenticated user and org details.
Returns
User object with org, plan, and feature flags.
Error responses
All errors follow this shape:
{ "error": "Human-readable message" }400401403404429500