API reference
The AgentRuntime REST endpoints for workflows, runs, human tasks, webhooks, connections, MCP, billing, and API keys.
On this page
This page lists the public REST endpoints you can call from scripts, CI jobs, and your own apps. It is for developers who already know what they want to automate and need the exact path, method, and permission.
New to the API? Start with API authentication to get a token, then copy a request from API examples.
Base URL: https://api.agentruntime.io
This page covers the stable, customer-facing endpoints. Other paths you may see in browser developer tools belong to the Console and can change without notice.
Before you call an endpoint
Every request needs one of:
- A personal access token (PAT): send
Authorization: Bearer pat_.... The token already belongs to one workspace, so you do not need to send a workspace header. See API authentication. - A Console session cookie: used by the Console in your browser.
Who can call what
The Role column shows the lowest workspace or project role that can call the endpoint. If you use a PAT, the token's scopes must also allow the call.
| Shorthand | Meaning |
|---|---|
| viewer+ | project_viewer or higher |
| contributor+ | project_contributor or higher |
| project_admin | project_admin or higher |
| tenant_admin | Workspace admin (billing and workspace-level settings) |
Responses and errors
Successful calls return JSON. Errors return a JSON body like { "error": "..." }.
| Status | Meaning |
|---|---|
400 | The request is malformed or a required field is missing |
401 | Missing or invalid authentication |
403 | Your role or the token's scopes do not allow this call |
404 | The resource does not exist, or you cannot see it |
409 | A conflict, for example revision_conflict when you save over a newer version of a workflow |
422 | Validation error (workflow graph, bindings, billing) |
429 | Rate limited. Wait for the Retry-After header, then retry |
5xx | Temporary server error. Retry with exponential backoff |
Workflows
A workflow has one Live copy (the draft in the Console) that you edit and run, plus optional frozen published versions. Saving changes the Live copy straight away; you only need to publish when you want a version that callers can pin to. See Workflow Studio.
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/workflows | viewer+ | List workflows |
POST | /v1/workflows | contributor+ | Create a workflow |
GET | /v1/workflows/{id} | viewer+ | Get a workflow (the Live copy by default) |
PATCH | /v1/workflows/{id} | contributor+ | Update the Live copy (name, description, graph, or saved run defaults) |
DELETE | /v1/workflows/{id} | contributor+ | Archive the workflow |
POST | /v1/workflows/{id}/versions | contributor+ | Publish a version (freezes the Live copy) |
GET | /v1/workflows/{id}/versions | viewer+ | List published versions |
POST | /v1/workflows/{id}/validate | contributor+ | Check a graph without running it (a dry run) |
POST | /v1/workflows/{id}/command | contributor+ | Start, pause, resume, or stop a run |
GET | /v1/workflows/{id}/runs | viewer+ | List runs of this workflow |
GET | /v1/workflows/{id}/stream | viewer+ | WebSocket stream of live run events |
When you PATCH a workflow you can send base_revision (the revision you last read). If someone else saved in between, the call fails with 409 revision_conflict and saves nothing, so you never overwrite their work.
Start, pause, resume, stop
POST /v1/workflows/{id}/command
{
"command": "start",
"version": "live",
"params": {
"trigger_payload": {
"topic": "weekly digest",
"message": "Hello"
}
}
}| Field | Description |
|---|---|
command | start (the default), pause, resume, or stop |
version | What to run: live (the default), published (the newest published version), or a version number such as 3 |
params.trigger_payload | The input for the run. Steps read it as {{input.*}} |
params.trigger_steps | Optional per-step input overrides, keyed by step id |
params.run_id | For pause, resume, and stop: the run to control |
params.mode | For stop: immediate (the default, cancels calls in flight), graceful (running steps finish), or force (like immediate, retried until it is recorded). Any other value is refused with 400. |
start returns 202 Accepted with the new run_id, a status, and ran (which copy of the workflow ran). Keep the run_id to check progress.
Runs and human tasks
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/runs | viewer+ | Runs across the workspace (the data behind Command Center) |
GET | /v1/workflows/{id}/runs/{runID}/summary | viewer+ | Current status of one run |
GET | /v1/workflows/{id}/runs/{runID}/events | viewer+ | Step-by-step event log |
GET | /v1/workflows/{id}/runs/{runID}/context | viewer+ | Run input and step results |
GET | /v1/tasks/pending | viewer+ | Human tasks waiting for a decision, across the workspace |
GET | /v1/workflows/{id}/runs/{runID}/tasks/pending | viewer+ | Waiting tasks for one run |
POST | /v1/workflows/{id}/runs/{runID}/tasks/{task_id}/complete | contributor+ | Approve or reject a task |
Complete-task body:
{
"approved": true,
"result": {
"comment_body": "Optional fields merged into the step result"
}
}The step result always includes approved. The Console Approve and Reject buttons send only { "approved": true } or { "approved": false }. See Human tasks.
Run event types
GET /v1/workflows/{id}/runs/{runID}/events returns these event_type values. See also Runs and Command Center.
Run lifecycle
event_type | Description |
|---|---|
run_started | The run was created with its input and workflow version |
run_paused / run_resumed | The run was paused or resumed |
run_stopped | Someone stopped the run |
run_completed | Every step finished; the run succeeded |
run_failed | A step failed, so the run failed |
run_context_snapshot | A snapshot of the run's state (input and step results) |
Steps
event_type | Description |
|---|---|
step_scheduled | A step's dependencies are done, so it is ready to run |
step_dispatched | The step was handed to a worker |
step_execution_started | A worker started the step |
step_completed | The step finished. A rejected approval also completes, with data.skipped: true |
step_failed | The step failed. The run fails with it |
step_skipped | The step was skipped (Skip when, a disabled step, or a skipped step it depends on) |
step_cancelled | The run was stopped while the step was running, and its call was cancelled (data.reason: "run_stopped"). The call may already have had an effect. |
step_lease_expired | The worker running the step stopped responding. The step is recovered or fails with WORKER_LOST |
step_revision_requested | A reviewer sent work back for changes, so the steps run again |
step_input_provided | A person answered a step's question, so the step runs again with the answer |
child_run_linked | A workflow step started its child run |
People, agents and conversations
event_type | Description |
|---|---|
human_task_created / human_task_completed | A task was created for a person, and later answered |
agent_turn_progress | Progress from an agent step (tool calls, messages) |
agent_inbox_received / agent_inbox_decision | An agent received a handoff and decided what to do with it |
agent_opinion_asked / agent_opinion_answered | An agent asked a person's view without pausing, and the answer that came back |
contact_message_received | A channel contact (for example a WhatsApp customer) wrote while this run was handling them |
conversation_message_received / conversation_message_sent | A message reached, or was posted by, a conversation session run |
session_waiting | A session run finished its work and waits for the next message |
New event types can appear over time. Ignore types you don't recognise rather than failing on them.
Inbound webhooks
Inbound webhooks let another system start a workflow run. See Inbound webhooks for setup and for how to sign requests.
| Method | Path | Role | Description |
|---|---|---|---|
POST | /v1/inbound-webhooks | contributor+ | Create a subscription |
GET | /v1/inbound-webhooks | viewer+ | List subscriptions |
PATCH | /v1/inbound-webhooks/{id} | contributor+ | Change what a subscription runs (Live, published, or a version) |
DELETE | /v1/inbound-webhooks/{id} | contributor+ | Delete a subscription |
POST | /v1/inbound-webhooks/{subscription_id} | Signature | Public ingress: the sender calls this to start a run |
Create a subscription:
{
"workflow_id": "workflow-uuid",
"name": "form-leads",
"automation_pat_id": "optional-existing-api-key-id",
"automation_bearer": "pat_…"
}The response includes ingress_url, signing_secret (shown once), and the subscription.
The sender does not use a token. Each ingress request needs:
X-Agentruntime-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256>, signed with thesigning_secretIdempotency-Key: <unique id per event>, so retries do not start duplicate runsContent-Type: application/json
Connections
A connection stores the credentials AgentRuntime uses to reach another service. See Connections.
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/connections | viewer+ | List connections |
POST | /v1/connections | contributor+ | Create a custom connection |
PATCH | /v1/connections/{id} | contributor+ | Update a connection |
DELETE | /v1/connections/{id} | project_admin | Delete a connection |
GET | /v1/connections/{id}/credentials | viewer+ | Credential metadata (key names, not secret values) |
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/connections/google/config | viewer+ | Whether Google connect is available |
POST | /v1/connections/google/oauth-url | contributor+ | Start the Google sign-in |
POST | /v1/connections/google/complete | contributor+ | Finish the Google sign-in |
GET | /v1/connections/google/accounts/{connectionId} | viewer+ | The Google account and its enabled services |
PATCH | /v1/connections/google/accounts/{connectionId}/services | contributor+ | Turn Google services on or off |
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/connections/whatsapp/config | viewer+ | Whether WhatsApp connect is available |
POST | /v1/connections/whatsapp/complete | contributor+ | Finish embedded signup |
POST | /v1/connections/whatsapp/manual | contributor+ | Connect with WhatsApp Business account credentials |
MCP servers and instances
An MCP instance is a tool server (such as Postgres or GitHub) installed in your workspace. See MCP instances and Custom MCP servers.
Read calls (GET) are viewer+. Create and update calls (POST, PATCH) are contributor+. Delete calls are project_admin.
Catalog and servers
| Method | Path | Description |
|---|---|---|
GET | /v1/mcp/platform-catalog | The built-in connector catalog |
GET | /v1/mcp/tools | Tool catalog |
GET | /v1/mcp/servers | Your workspace's MCP servers |
POST | /v1/mcp/servers | Register a custom server |
GET | /v1/mcp/servers/{id} | Server detail |
GET | /v1/mcp/servers/{id}/discover | Discover the server's tools |
POST | /v1/mcp/servers/{id}/versions | Publish a server version |
POST | /v1/mcp/servers/{id}/validate | Run validation checks |
POST | /v1/mcp/servers/{id}/connections/{connection_id}/validate | Check that a connection works with a server |
Instances and config profiles
| Method | Path | Description |
|---|---|---|
GET | /v1/mcp/instances | List instances |
POST | /v1/mcp/instances | Create an instance |
PATCH | /v1/mcp/instances/{id} | Update an instance |
GET | /v1/mcp/instances/{id}/config-profiles | List config profiles |
POST | /v1/mcp/instances/{id}/config-profiles | Create a config profile |
PATCH | /v1/mcp/instances/{id}/config-profiles/{profile_id} | Update a profile, including which connection it uses |
POST | /v1/mcp/instances/{id}/config-profiles/{profile_id}/set-active | Make a profile the active one |
AI and chat
| Method | Path | Role | Description |
|---|---|---|---|
POST | /v1/autopilot/chat | viewer+ | Send a message to Autopilot |
GET | /v1/autopilot/stream | viewer+ | Stream Autopilot's reply |
GET | /v1/llm-provider-keys/catalog | viewer+ | The LLM keys available to your workspace |
GET | /v1/llm/models/catalog | viewer+ | The models you can pick in workflows and agents |
See LLM providers and Autopilot and chat.
Memory
Memory is a preview feature. The Console has no Memory screen yet. See Memory for what it does and its limits.
| Method | Path | Description |
|---|---|---|
POST | /v1/memory/search | Search memory (needs memory read access) |
POST | /v1/memory/index-conversation | Add a chat conversation to memory |
POST | /v1/memory/index-file | Add a work file to memory |
POST | /v1/memory/extract/batch | Start a large batch import |
GET | /v1/memory/extract/{jobId} | Check an import job |
GET | /v1/memory/episodes/{episodeId} | Get one stored episode |
Agents
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/agents | viewer+ | List agents |
POST | /v1/agents | contributor+ | Create an agent |
GET | /v1/agents/{id} | viewer+ | Get an agent |
PATCH | /v1/agents/{id} | contributor+ | Update an agent |
DELETE | /v1/agents/{id} | project_admin | Delete an agent |
Analytics
All analytics endpoints are GET and viewer+. They accept window=month|week|all, or bounded from and to. Time-series endpoints also accept a granularity. See Analytics.
| Endpoint | Metric |
|---|---|
/v1/analytics/live-runs | Runs in progress now |
/v1/analytics/success-rate | Run success percentage |
/v1/analytics/execution-duration | Wall-clock run time |
/v1/analytics/runs-count | Runs in the window |
/v1/analytics/steps-executed | Metered workflow steps |
/v1/analytics/credits-consumed | Credits used in the window |
/v1/analytics/steps-summary | Step-type breakdown and latency |
/v1/analytics/runs-timeseries | Run count over time |
/v1/analytics/usage-timeseries | Usage over time |
Billing
Read endpoints need billing read access. Changes (trial, subscription, top-ups, codes) need tenant_admin. See Billing and credits.
| Method | Path | Description |
|---|---|---|
GET | /v1/billing/summary | Billing summary |
GET | /v1/billing/plans | Plans available to your workspace (plan_code, price, trial details) |
GET | /v1/billing/status | Subscription and trial status |
GET | /v1/billing/usage | Credit balances, in microcredits |
GET | /v1/billing/usage-dimensions | Usage breakdown dimensions |
GET | /v1/billing/usage-history | Metered usage history |
GET | /v1/billing/payment-history | Payments and top-ups |
GET | /v1/billing/action-pricing | Prices for each billable action |
POST | /v1/billing/topups/payg/intent | Start a pay-as-you-go top-up |
POST | /v1/billing/trial | Start a trial |
POST | /v1/billing/subscription | Start a subscription |
POST | /v1/billing/subscription/change-plan | Change plan |
POST | /v1/billing/subscription/cancel | Cancel (at the end of the period by default) |
POST | /v1/billing/subscription/convert-trial-now | End a trial early |
POST | /v1/billing/codes/apply | Apply a billing code |
POST | /v1/billing/discounts/validate | Check a discount code |
Personal access tokens
Most people create tokens in the Console under Settings → API keys. These endpoints do the same from code.
| Method | Path | Role | Description |
|---|---|---|---|
GET | /v1/pats | viewer+ | List tokens (no secrets) |
POST | /v1/pats | contributor+ | Create a token |
GET | /v1/pats/{id}/reveal | project_admin | Show a stored token again |
DELETE | /v1/pats/{id} | contributor+ | Revoke a token |
A token can never do more than the person who created it.
Next steps
- API examples: copy-paste requests for the most common calls
- API authentication: tokens, scopes, and sign-in options
- Platform MCP: drive AgentRuntime from an AI assistant
- Need higher rate limits or an SLA? Email support@agentruntime.io.