Wake Agent
Queue a run for the agent (a manual heartbeat). The run is only recorded here; an external runner executes queued runs. An optional `task_id` must belong to this company. If an identical run (same agent and task) is already queued, that run is returned instead of a new one. Fails with 400 `INVALID_STATE` for agents that are `paused`, `pending_approval` or `terminated`. Publishes `run.created`.
Queue a run for the agent (a manual heartbeat).
The run is only recorded here; an external runner executes queued runs. An
optional task_id must belong to this company. If an identical run (same agent
and task) is already queued, that run is returned instead of a new one. Fails
with 400 INVALID_STATE for agents that are paused, pending_approval or
terminated. Publishes run.created.
HTTPBearerAuthorizationBearer <token>agent_id*Agent Iduuidcompany_id*Company Iduuidapplication/json- body
reason?string|nulltask_id?|nullSuccessful Response
application/json- response
agent_id*Agent Iduuidcost_cents*Cost Centscreated_at*|nullended_at*|nullerror*string|nullheartbeat_at?|nullid*Iduuidroutine_id*|nullrunner_id?string|nullstarted_at*|nullstatus*Statussummary*string|nulltask_id*|nulltokens_in*Tokens Intokens_out*Tokens Outtrigger*Triggercurl -X POST "https://example.com/api/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/wake" \ -H "Content-Type: application/json" \ -d '{}'{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "cost_cents": 0, "created_at": "2019-08-24T14:15:22Z", "ended_at": "2019-08-24T14:15:22Z", "error": "string", "heartbeat_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "routine_id": "f53c5ff7-cfb7-4f43-8b79-3421a01d8e2a", "runner_id": "string", "started_at": "2019-08-24T14:15:22Z", "status": "string", "summary": "string", "task_id": "736fde4d-9029-4915-8189-01353d6982cb", "tokens_in": 0, "tokens_out": 0, "trigger": "string"}Terminate Agent POST
Terminate an agent (soft delete): it leaves the org chart but its history stays. The agent's direct reports move to the agent's own manager (or become roots), and its `queued` and `running` runs are cancelled with the error "Agent terminated". Assigned tasks and routines are left unchanged. Publishes `agent.updated` and `run.updated` for each cancelled run.
Get Org Chart GET
Get the reporting tree of non-terminated agents. Returns the root nodes, each with nested `reports`. Agents without a manager, or whose manager is terminated, are roots. Every agent carries the same month-to-date stats as the agent list.