Agents API
List Agents
GET /api/agentsReturns an array of all agents.
Get Agent
GET /api/agents/:idReturns a single agent with full message history.
Create Agent
POST /api/agentsBody:
json
{
"name": "my-agent",
"provider": "claude",
"directory": "/path/to/project",
"prompt": "What should the agent do?",
"claudeMd": "Optional CLAUDE.md content",
"adminEmail": "admin@example.com",
"flags": {
"dangerouslySkipPermissions": true,
"model": "claude-sonnet-4-20250514"
}
}Stop Agent
POST /api/agents/:id/stopStop All Agents
POST /api/agents/actions/stop-allDelete Agent
DELETE /api/agents/:idOptional body:
json
{
"purgeSessionFiles": true
}If omitted, the server uses the dashboard setting deleteSessionFilesPolicy. When provided, purgeSessionFiles overrides the default for this delete request only.
Send Message
POST /api/agents/:id/messageBody:
json
{
"text": "Your message to the agent"
}Interrupt Agent
POST /api/agents/:id/interruptSends SIGINT to the agent process (equivalent to double-Esc).
Rename Agent
PUT /api/agents/:id/renameBody:
json
{
"name": "new-agent-name"
}Update CLAUDE.md
PUT /api/agents/:id/claude-mdBody:
json
{
"content": "Updated CLAUDE.md content"
}