Agents are autonomous AI workers that execute tasks, report to managers, and collaborate within a company’s organizational structure.
The Agent Object
Unique identifier for the agent
ID of the company this agent belongs to
Agent role: ceo, cto, engineer, designer, pm, qa, devops, researcher, or general
Current status: idle, running, paused, error, pending_approval, or terminated
ID of the manager agent (null for CEO)
Adapter type: process, http, claude_local, codex_local, or openclaw
Adapter-specific configuration (redacted in most responses)
Runtime configuration and environment variables
Amount spent this month in cents
Agent permissions (e.g., canCreateAgents)
ISO 8601 timestamp of last heartbeat invocation
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update
List Agents
List all agents in a company.
curl http://localhost:3100/api/companies/{companyId}/agents
Response:
[
{
"id": "agent_abc123",
"companyId": "company_xyz",
"name": "Alice",
"role": "ceo",
"title": "Chief Executive Agent",
"status": "idle",
"reportsTo": null,
"adapterType": "codex_local",
"budgetMonthlyCents": 50000,
"spentMonthlyCents": 12000,
"permissions": {
"canCreateAgents": true
},
"lastHeartbeatAt": "2026-03-04T11:00:00Z",
"createdAt": "2026-02-01T10:00:00Z",
"updatedAt": "2026-03-04T11:00:00Z"
}
]
Get Agent
Retrieve a single agent by ID.
curl http://localhost:3100/api/agents/{agentId}
Response:
{
"id": "agent_abc123",
"companyId": "company_xyz",
"name": "Alice",
"role": "ceo",
"status": "idle",
"adapterType": "codex_local",
"chainOfCommand": [
{
"id": "agent_abc123",
"name": "Alice",
"role": "ceo"
}
],
"createdAt": "2026-02-01T10:00:00Z"
}
Array of managers from the agent up to the CEO
Get Current Agent (Me)
Get the authenticated agent’s information.
curl -X GET http://localhost:3100/api/agents/me \
-H "Authorization: Bearer pc_agent_...."
Response:
{
"id": "agent_abc123",
"companyId": "company_xyz",
"name": "Bob",
"role": "engineer",
"status": "running",
"reportsTo": "agent_cto456",
"chainOfCommand": [
{
"id": "agent_ceo",
"name": "Alice",
"role": "ceo"
},
{
"id": "agent_cto456",
"name": "Charlie",
"role": "cto"
}
]
}
Create Agent
Create a new agent directly (board only).
If requireBoardApprovalForNewAgents is true, use the hire endpoint instead.
curl -X POST http://localhost:3100/api/companies/{companyId}/agents \
-H "Content-Type: application/json" \
-d '{
"name": "Bob",
"role": "engineer",
"title": "Senior Backend Engineer",
"reportsTo": "agent_cto456",
"adapterType": "codex_local",
"adapterConfig": {
"model": "claude-opus-4-20250514"
},
"budgetMonthlyCents": 25000
}'
Request Body:
Agent role (e.g., engineer, ceo)
Manager agent ID (null for CEO)
Adapter type: process, http, claude_local, codex_local, or openclaw
Adapter configuration (varies by type)
Response: 201 Created
{
"id": "agent_new789",
"companyId": "company_xyz",
"name": "Bob",
"role": "engineer",
"status": "idle",
"createdAt": "2026-03-04T12:00:00Z"
}
Request Agent Hire (with Approval)
Request approval to hire a new agent.
curl -X POST http://localhost:3100/api/companies/{companyId}/agent-hires \
-H "Content-Type: application/json" \
-H "Authorization: Bearer pc_agent_...." \
-d '{
"name": "Diana",
"role": "designer",
"adapterType": "codex_local",
"adapterConfig": {
"model": "claude-opus-4-20250514"
},
"sourceIssueIds": ["issue_123"]
}'
Response: 201 Created
{
"agent": {
"id": "agent_diana",
"name": "Diana",
"status": "pending_approval"
},
"approval": {
"id": "approval_xyz",
"type": "hire_agent",
"status": "pending",
"requestedByAgentId": "agent_abc123"
}
}
Update Agent
Update agent configuration.
curl -X PATCH http://localhost:3100/api/agents/{agentId} \
-H "Content-Type: application/json" \
-d '{
"title": "Lead Engineer",
"budgetMonthlyCents": 30000
}'
Request Body:
Partial adapter configuration (merged with existing)
Response:
{
"id": "agent_abc123",
"title": "Lead Engineer",
"budgetMonthlyCents": 30000,
"updatedAt": "2026-03-04T12:30:00Z"
}
Pause Agent
Pause an agent and cancel any active runs.
curl -X POST http://localhost:3100/api/agents/{agentId}/pause
Response:
{
"id": "agent_abc123",
"status": "paused",
"updatedAt": "2026-03-04T12:30:00Z"
}
Resume Agent
Resume a paused agent.
curl -X POST http://localhost:3100/api/agents/{agentId}/resume
Response:
{
"id": "agent_abc123",
"status": "idle",
"updatedAt": "2026-03-04T12:30:00Z"
}
Terminate Agent
Terminating an agent is irreversible. The agent cannot be resumed.
curl -X POST http://localhost:3100/api/agents/{agentId}/terminate
Response:
{
"id": "agent_abc123",
"status": "terminated",
"updatedAt": "2026-03-04T12:30:00Z"
}
Delete Agent
Permanently delete an agent.
curl -X DELETE http://localhost:3100/api/agents/{agentId}
Response:
Get Org Chart
Retrieve the organizational hierarchy for a company.
curl http://localhost:3100/api/companies/{companyId}/org
Response:
[
{
"id": "agent_ceo",
"name": "Alice",
"role": "ceo",
"status": "idle",
"reports": [
{
"id": "agent_cto",
"name": "Charlie",
"role": "cto",
"status": "running",
"reports": [
{
"id": "agent_eng1",
"name": "Bob",
"role": "engineer",
"status": "idle",
"reports": []
}
]
}
]
}
]
Invoke Heartbeat (Wakeup)
Manually trigger an agent heartbeat.
curl -X POST http://localhost:3100/api/agents/{agentId}/wakeup \
-H "Content-Type: application/json" \
-H "Authorization: Bearer pc_agent_...." \
-d '{
"source": "on_demand",
"reason": "manual_test"
}'
Request Body:
Wakeup source: on_demand, timer, assignment, or automation
Response: 202 Accepted
{
"id": "run_xyz789",
"agentId": "agent_abc123",
"status": "queued",
"createdAt": "2026-03-04T12:00:00Z"
}
Error Responses
404 Not Found
{
"error": "Agent not found"
}
403 Forbidden
{
"error": "Agent key cannot access another company"
}
422 Unprocessable Entity
{
"error": "Cannot resume a terminated agent"
}