For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
    • Overview
  • Runtype API
      • STREAMExecute a flow or agent
      • STREAMApprove or deny a pending approval
      • STREAMContinue a paused execution
      • STREAMResume a paused execution
Dashboard
LogoLogo
Runtype APIDispatch

Execute a flow or agent

POST
/v1/dispatch
POST
/v1/dispatch
$curl -X POST https://api.runtype.com/v1/dispatch \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "flow": {
> "name": "Sales Analysis",
> "steps": [
> {
> "config": {
> "model": "gpt-4",
> "outputVariable": "sales_analysis",
> "responseFormat": "markdown",
> "userPrompt": "Analyze the sales performance for {{_record.metadata.quarter}} in {{_record.metadata.region}}."
> },
> "enabled": true,
> "id": "analyze-sales",
> "name": "Analyze Sales Performance",
> "order": 1,
> "type": "prompt"
> }
> ]
> },
> "options": {
> "autoAppendMetadata": true,
> "flowMode": "virtual",
> "recordMode": "virtual",
> "streamResponse": true
> },
> "record": {
> "metadata": {
> "growth_rate": "18%",
> "quarter": "Q4 2024",
> "region": "North America",
> "sales_team": "Team Alpha",
> "top_products": [
> "Product A",
> "Product B",
> "Product C"
> ],
> "total_revenue": "$2.5M"
> },
> "name": "Q4 Sales Report",
> "type": "report"
> }
>}'
Main dispatch endpoint for flow and agent execution with record resolution. Supports streaming via SSE or synchronous JSON responses.
Was this page helpful?
Previous

Approve or deny a pending approval

Next
Built with

Authentication

AuthorizationBearer
API key or Clerk session token

Request

Dispatch request body (see DispatchRequestSchema)

Response

Execution result (SSE stream or JSON)

object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object
OR
object

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error