Skip to content
AgentOS
DocumentationAPI overview

Reference

API overview

Authentication, resources and conventions of the REST API.

The REST API manages agents, starts runs and reads their results. The console is built on the same API.

Base URL

Base URLText
https://api.example.com/v1

Requests and responses are JSON over HTTPS. Timestamps are ISO 8601 in UTC.

Authentication

Send an API key as a bearer token. Keys are created in the console under Settings. Each key belongs to one environment and carries scopes that limit what it can do.

ScopeAllows
agents:deployCreate agents and deploy versions.
runs:createStart runs.
runs:readRead runs, steps and outputs.
policies:writeCreate and change policies.
audit:readRead and export audit events.
usage:readRead usage and billing data.

Start a run

Start a runShell
curl https://api.example.com/v1/agents/support-triage/runs \  -H "Authorization: Bearer $AGENTOS_API_KEY" \  -H "Content-Type: application/json" \  --data '{"input": {"ticket_id": 48213}}'

The request returns as soon as the run is accepted. The run continues in the background.

ResponseHTTP
HTTP/1.1 202 AcceptedContent-Type: application/json {  "id": "run_4w21jb4rrgak",  "agent": "support-triage",  "version": 42,  "status": "running",  "created_at": "2026-11-24T07:02:55.200Z"}

Read a run

Fetch a run to see its status, steps and output. A run that is waiting for an approval reports who it is waiting for.

GET /v1/runs/run_vtqzd1rm1qw5JSON
{  "id": "run_vtqzd1rm1qw5",  "agent": "access-concierge",  "version": 22,  "status": "awaiting_approval",  "created_at": "2026-11-24T06:59:00.000Z",  "steps": [    { "kind": "trigger", "name": "event", "status": "completed" },    { "kind": "model", "name": "balanced", "status": "completed" },    { "kind": "tool", "name": "identity-provider.get_user", "status": "completed" },    { "kind": "approval", "name": "manager_of:j.alvarez", "status": "waiting" }  ],  "waiting_for": {    "approvers": ["manager_of:j.alvarez"],    "policy": "access-grants"  },  "output": null}

Resources

PathResource
/agentsAgent definitions and their versions.
/agents/{name}/runsStart a run of an agent.
/runs/{id}A run with its steps, status and output.
/approvalsPending approvals. Approve or reject them.
/policiesPolicies, their tests and their decisions.
/integrationsConnected MCP servers and tool permissions.
/memory/{scope}Entries in a memory scope.
/audit/eventsAudit events.
/sandboxesSandbox templates and sessions.

Idempotency

Send an Idempotency-Key header with requests that create something. A repeated request with the same key returns the original result instead of starting a second run.

Pagination

List endpoints return a page of results and a next_cursor. Pass it as the cursor parameter to get the next page. When next_cursor is null, there are no more results.

Errors

Errors use standard HTTP status codes and a JSON body with a stable code.

Error responseHTTP
HTTP/1.1 403 ForbiddenContent-Type: application/json {  "error": {    "code": "policy_denied",    "message": "Tool is not granted to this agent.",    "policy": "least-privilege",    "request_id": "req_8f2k4m9x1q7d"  }}
StatusCodeMeaning
400invalid_requestThe request could not be parsed.
401unauthenticatedThe API key is missing or not valid.
403forbiddenThe key lacks the scope for this request.
403policy_deniedA policy denied the action.
404not_foundThe resource does not exist in this environment.
409conflictThe resource changed since it was read.
422validation_failedA field is missing or not valid.
429rate_limitedToo many requests. Retry after the time in Retry-After.

Webhooks

Subscribe to events such as run.completed, run.failed and approval.requested to react without polling. Each delivery is signed, so you can verify that it came from your workspace.