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

Note

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.

ShorthandMeaning
viewer+project_viewer or higher
contributor+project_contributor or higher
project_adminproject_admin or higher
tenant_adminWorkspace admin (billing and workspace-level settings)

Responses and errors

Successful calls return JSON. Errors return a JSON body like { "error": "..." }.

StatusMeaning
400The request is malformed or a required field is missing
401Missing or invalid authentication
403Your role or the token's scopes do not allow this call
404The resource does not exist, or you cannot see it
409A conflict, for example revision_conflict when you save over a newer version of a workflow
422Validation error (workflow graph, bindings, billing)
429Rate limited. Wait for the Retry-After header, then retry
5xxTemporary 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.

MethodPathRoleDescription
GET/v1/workflowsviewer+List workflows
POST/v1/workflowscontributor+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}/versionscontributor+Publish a version (freezes the Live copy)
GET/v1/workflows/{id}/versionsviewer+List published versions
POST/v1/workflows/{id}/validatecontributor+Check a graph without running it (a dry run)
POST/v1/workflows/{id}/commandcontributor+Start, pause, resume, or stop a run
GET/v1/workflows/{id}/runsviewer+List runs of this workflow
GET/v1/workflows/{id}/streamviewer+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"
    }
  }
}
FieldDescription
commandstart (the default), pause, resume, or stop
versionWhat to run: live (the default), published (the newest published version), or a version number such as 3
params.trigger_payloadThe input for the run. Steps read it as {{input.*}}
params.trigger_stepsOptional per-step input overrides, keyed by step id
params.run_idFor pause, resume, and stop: the run to control
params.modeFor 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

MethodPathRoleDescription
GET/v1/runsviewer+Runs across the workspace (the data behind Command Center)
GET/v1/workflows/{id}/runs/{runID}/summaryviewer+Current status of one run
GET/v1/workflows/{id}/runs/{runID}/eventsviewer+Step-by-step event log
GET/v1/workflows/{id}/runs/{runID}/contextviewer+Run input and step results
GET/v1/tasks/pendingviewer+Human tasks waiting for a decision, across the workspace
GET/v1/workflows/{id}/runs/{runID}/tasks/pendingviewer+Waiting tasks for one run
POST/v1/workflows/{id}/runs/{runID}/tasks/{task_id}/completecontributor+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_typeDescription
run_startedThe run was created with its input and workflow version
run_paused / run_resumedThe run was paused or resumed
run_stoppedSomeone stopped the run
run_completedEvery step finished; the run succeeded
run_failedA step failed, so the run failed
run_context_snapshotA snapshot of the run's state (input and step results)

Steps

event_typeDescription
step_scheduledA step's dependencies are done, so it is ready to run
step_dispatchedThe step was handed to a worker
step_execution_startedA worker started the step
step_completedThe step finished. A rejected approval also completes, with data.skipped: true
step_failedThe step failed. The run fails with it
step_skippedThe step was skipped (Skip when, a disabled step, or a skipped step it depends on)
step_cancelledThe 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_expiredThe worker running the step stopped responding. The step is recovered or fails with WORKER_LOST
step_revision_requestedA reviewer sent work back for changes, so the steps run again
step_input_providedA person answered a step's question, so the step runs again with the answer
child_run_linkedA workflow step started its child run

People, agents and conversations

event_typeDescription
human_task_created / human_task_completedA task was created for a person, and later answered
agent_turn_progressProgress from an agent step (tool calls, messages)
agent_inbox_received / agent_inbox_decisionAn agent received a handoff and decided what to do with it
agent_opinion_asked / agent_opinion_answeredAn agent asked a person's view without pausing, and the answer that came back
contact_message_receivedA channel contact (for example a WhatsApp customer) wrote while this run was handling them
conversation_message_received / conversation_message_sentA message reached, or was posted by, a conversation session run
session_waitingA 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.

MethodPathRoleDescription
POST/v1/inbound-webhookscontributor+Create a subscription
GET/v1/inbound-webhooksviewer+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}SignaturePublic 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 the signing_secret
  • Idempotency-Key: <unique id per event>, so retries do not start duplicate runs
  • Content-Type: application/json

Connections

A connection stores the credentials AgentRuntime uses to reach another service. See Connections.

MethodPathRoleDescription
GET/v1/connectionsviewer+List connections
POST/v1/connectionscontributor+Create a custom connection
PATCH/v1/connections/{id}contributor+Update a connection
DELETE/v1/connections/{id}project_adminDelete a connection
GET/v1/connections/{id}/credentialsviewer+Credential metadata (key names, not secret values)

Google

MethodPathRoleDescription
GET/v1/connections/google/configviewer+Whether Google connect is available
POST/v1/connections/google/oauth-urlcontributor+Start the Google sign-in
POST/v1/connections/google/completecontributor+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}/servicescontributor+Turn Google services on or off

WhatsApp

MethodPathRoleDescription
GET/v1/connections/whatsapp/configviewer+Whether WhatsApp connect is available
POST/v1/connections/whatsapp/completecontributor+Finish embedded signup
POST/v1/connections/whatsapp/manualcontributor+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

MethodPathDescription
GET/v1/mcp/platform-catalogThe built-in connector catalog
GET/v1/mcp/toolsTool catalog
GET/v1/mcp/serversYour workspace's MCP servers
POST/v1/mcp/serversRegister a custom server
GET/v1/mcp/servers/{id}Server detail
GET/v1/mcp/servers/{id}/discoverDiscover the server's tools
POST/v1/mcp/servers/{id}/versionsPublish a server version
POST/v1/mcp/servers/{id}/validateRun validation checks
POST/v1/mcp/servers/{id}/connections/{connection_id}/validateCheck that a connection works with a server

Instances and config profiles

MethodPathDescription
GET/v1/mcp/instancesList instances
POST/v1/mcp/instancesCreate an instance
PATCH/v1/mcp/instances/{id}Update an instance
GET/v1/mcp/instances/{id}/config-profilesList config profiles
POST/v1/mcp/instances/{id}/config-profilesCreate 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-activeMake a profile the active one

AI and chat

MethodPathRoleDescription
POST/v1/autopilot/chatviewer+Send a message to Autopilot
GET/v1/autopilot/streamviewer+Stream Autopilot's reply
GET/v1/llm-provider-keys/catalogviewer+The LLM keys available to your workspace
GET/v1/llm/models/catalogviewer+The models you can pick in workflows and agents

See LLM providers and Autopilot and chat.

Memory

Note

Memory is a preview feature. The Console has no Memory screen yet. See Memory for what it does and its limits.

MethodPathDescription
POST/v1/memory/searchSearch memory (needs memory read access)
POST/v1/memory/index-conversationAdd a chat conversation to memory
POST/v1/memory/index-fileAdd a work file to memory
POST/v1/memory/extract/batchStart a large batch import
GET/v1/memory/extract/{jobId}Check an import job
GET/v1/memory/episodes/{episodeId}Get one stored episode

Agents

MethodPathRoleDescription
GET/v1/agentsviewer+List agents
POST/v1/agentscontributor+Create an agent
GET/v1/agents/{id}viewer+Get an agent
PATCH/v1/agents/{id}contributor+Update an agent
DELETE/v1/agents/{id}project_adminDelete 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.

EndpointMetric
/v1/analytics/live-runsRuns in progress now
/v1/analytics/success-rateRun success percentage
/v1/analytics/execution-durationWall-clock run time
/v1/analytics/runs-countRuns in the window
/v1/analytics/steps-executedMetered workflow steps
/v1/analytics/credits-consumedCredits used in the window
/v1/analytics/steps-summaryStep-type breakdown and latency
/v1/analytics/runs-timeseriesRun count over time
/v1/analytics/usage-timeseriesUsage over time

Billing

Read endpoints need billing read access. Changes (trial, subscription, top-ups, codes) need tenant_admin. See Billing and credits.

MethodPathDescription
GET/v1/billing/summaryBilling summary
GET/v1/billing/plansPlans available to your workspace (plan_code, price, trial details)
GET/v1/billing/statusSubscription and trial status
GET/v1/billing/usageCredit balances, in microcredits
GET/v1/billing/usage-dimensionsUsage breakdown dimensions
GET/v1/billing/usage-historyMetered usage history
GET/v1/billing/payment-historyPayments and top-ups
GET/v1/billing/action-pricingPrices for each billable action
POST/v1/billing/topups/payg/intentStart a pay-as-you-go top-up
POST/v1/billing/trialStart a trial
POST/v1/billing/subscriptionStart a subscription
POST/v1/billing/subscription/change-planChange plan
POST/v1/billing/subscription/cancelCancel (at the end of the period by default)
POST/v1/billing/subscription/convert-trial-nowEnd a trial early
POST/v1/billing/codes/applyApply a billing code
POST/v1/billing/discounts/validateCheck a discount code

Personal access tokens

Most people create tokens in the Console under Settings → API keys. These endpoints do the same from code.

MethodPathRoleDescription
GET/v1/patsviewer+List tokens (no secrets)
POST/v1/patscontributor+Create a token
GET/v1/pats/{id}/revealproject_adminShow 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

Edit this pageagentruntime-io/agentruntime-docs