Skip to main content
The swarm agents API backs the Agents page. Use these endpoints to read live agent state or manage agents programmatically instead of through the UI. All endpoints are scoped to the authenticated workspace.

List agents

Returns every agent registered to the workspace. Response 200:
Each agent’s status is one of active, idle, paused, or error. Returns 500 with { "error": "Failed to fetch agents." } if the lookup fails.

Deploy an agent

Adds a new agent to the swarm. The agent starts with status active, zero completed tasks, and 100% uptime. Request body: Example:
Response 201:
Returns 400 with { "error": "Agent name and role are required." } when name or role is missing.

Pause or resume an agent

Flips the agent’s status. An active agent becomes paused; a paused agent becomes active. Toggling does not delete the agent or reset its task count. Example:
Response 200:
Returns 404 with { "error": "Agent with id <id> not found." } when no agent matches the ID.