Agents API
Agent endpoints cover lifecycle control, execution, telemetry, and diagnostics.
Common endpoints
GET /api/agentslist agents in org scopePOST /api/agents/{id}/runexecute saved scriptPOST /api/agents/{id}/run-functionexecute a reusable functionPOST /api/agents/{id}/scriptpush or fetch script payloadsPOST /api/agents/{id}/step-statuscallback for step-level progressPOST /api/agents/{id}/video-analyzecreate workflow from recording
OpenClaw-specific endpoints
POST /api/agents/{id}/chatPOST /api/agents/{id}/chat/streamPOST /api/agents/{id}/manage
Use these for conversational execution and managed tooling flows.
Lifecycle controls
Agent management endpoints may include deploy, heartbeat, and tunnel operations.
Key practices:
- Require org ownership on every mutation.
- Protect machine endpoints with API keys.
- Emit structured telemetry for troubleshooting.
Error handling
Return machine-readable error codes for common categories:
agent_not_foundagent_not_readyinvalid_payloadexecution_timeoutpermission_denied
Reliability guidance
- Treat step-status callbacks as idempotent.
- Do not assume ordered callback delivery.
- Persist enough context to reconstruct run state after restarts.