> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Validate a prospective flow payload

POST https://api.runtype.com/v1/public/flows/validate
Content-Type: application/json

Validates a flow definition without creating it. Authentication is optional — authenticated requests get additional account-scoped checks.

Reference: https://docs.runtype.com/api-reference/runtype-api/flow-validation/validate-a-prospective-flow-payload

## Servers

- `https://api.runtype.com` (Production, default)
- `https://api.runtype-staging.com` (Staging)

## Request

### Body (application/json)

This endpoint expects a map from string to any.

- `map from string to any`

## Response

### 200

Validation result

- `context` (FlowValidationResultContext, required)
- `errors` (list of FlowValidationIssue, required)
- `recommendations` (list of FlowValidationIssue, required)
- `valid` (boolean, required)
- `warnings` (list of FlowValidationIssue, required)

## Errors

### 400 Bad Request Error

Invalid JSON body

- `error` (string, required)
- `code` (string, optional) — Stable error code. `insufficient_scope` marks an API key that lacks a scope this request needs.
- `details` (list of V1PublicFlowsValidatePostResponsesContentApplicationJsonSchemaDetailsItems, optional)
- `requiredScopes` (list of string, optional) — On `insufficient_scope`: every API key scope this request needs.

### 500 Internal Server Error

Internal server error

- `context` (FlowValidationResultContext, required)
- `errors` (list of FlowValidationIssue, required)
- `recommendations` (list of FlowValidationIssue, required)
- `valid` (boolean, required)
- `warnings` (list of FlowValidationIssue, required)

## Types

### FlowValidationResultContext

- `accountChecksPerformed` (boolean, required)
- `accountChecksSkipped` (boolean, required)
- `authenticated` (boolean, required)

### FlowValidationIssue

- `code` (string, required)
- `message` (string, required)
- `details` (any, optional)
- `path` (string, optional)
- `step` (FlowValidationIssueStep, optional)

### V1PublicFlowsValidatePostResponsesContentApplicationJsonSchemaDetailsItems

- `message` (string, required)
- `code` (string, optional) — Stable Runtype validation code (e.g. MISSING_REQUIRED_FIELD, INVALID_ENUM).
- `path` (string, optional) — Dotted JSON path to the offending field.
- `suggestion` (string, optional) — Actionable hint (allowed values, accepted range, …).

### FlowValidationIssueStep

- `index` (integer, required)
- `name` (string, required)
- `type` (string, required)

## Examples

### Validate Flow (Authenticated Account Checks)

**Request**

```json
{
  "flowSteps": [
    {
      "config": {
        "model": "gpt-5-mini",
        "text": "Use account tool",
        "tools": {
          "toolIds": [
            "tool_missing_flow_validation_docs_example"
          ]
        }
      },
      "name": "Agent Step",
      "type": "prompt"
    }
  ],
  "name": "Flow Validation Auth Context Example"
}
```

**Response**

```json
{
  "context": {
    "accountChecksPerformed": true,
    "accountChecksSkipped": true,
    "authenticated": true
  },
  "errors": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ],
  "recommendations": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ],
  "valid": true,
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ]
}
```

**SDK Code**

```python Validate Flow (Authenticated Account Checks)
import requests

url = "https://api.runtype.com/v1/public/flows/validate"

payload = {
    "flowSteps": [
        {
            "config": {
                "model": "gpt-5-mini",
                "text": "Use account tool",
                "tools": { "toolIds": ["tool_missing_flow_validation_docs_example"] }
            },
            "name": "Agent Step",
            "type": "prompt"
        }
    ],
    "name": "Flow Validation Auth Context Example"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Validate Flow (Authenticated Account Checks)
const url = 'https://api.runtype.com/v1/public/flows/validate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"flowSteps":[{"config":{"model":"gpt-5-mini","text":"Use account tool","tools":{"toolIds":["tool_missing_flow_validation_docs_example"]}},"name":"Agent Step","type":"prompt"}],"name":"Flow Validation Auth Context Example"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Validate Flow (Authenticated Account Checks)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/public/flows/validate"

	payload := strings.NewReader("{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"text\": \"Use account tool\",\n        \"tools\": {\n          \"toolIds\": [\n            \"tool_missing_flow_validation_docs_example\"\n          ]\n        }\n      },\n      \"name\": \"Agent Step\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Auth Context Example\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Validate Flow (Authenticated Account Checks)
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/public/flows/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"text\": \"Use account tool\",\n        \"tools\": {\n          \"toolIds\": [\n            \"tool_missing_flow_validation_docs_example\"\n          ]\n        }\n      },\n      \"name\": \"Agent Step\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Auth Context Example\"\n}"

response = http.request(request)
puts response.read_body
```

```java Validate Flow (Authenticated Account Checks)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/public/flows/validate")
  .header("Content-Type", "application/json")
  .body("{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"text\": \"Use account tool\",\n        \"tools\": {\n          \"toolIds\": [\n            \"tool_missing_flow_validation_docs_example\"\n          ]\n        }\n      },\n      \"name\": \"Agent Step\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Auth Context Example\"\n}")
  .asString();
```

```php Validate Flow (Authenticated Account Checks)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/public/flows/validate', [
  'body' => '{
  "flowSteps": [
    {
      "config": {
        "model": "gpt-5-mini",
        "text": "Use account tool",
        "tools": {
          "toolIds": [
            "tool_missing_flow_validation_docs_example"
          ]
        }
      },
      "name": "Agent Step",
      "type": "prompt"
    }
  ],
  "name": "Flow Validation Auth Context Example"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Validate Flow (Authenticated Account Checks)
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/public/flows/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"text\": \"Use account tool\",\n        \"tools\": {\n          \"toolIds\": [\n            \"tool_missing_flow_validation_docs_example\"\n          ]\n        }\n      },\n      \"name\": \"Agent Step\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Auth Context Example\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Validate Flow (Authenticated Account Checks)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "flowSteps": [
    [
      "config": [
        "model": "gpt-5-mini",
        "text": "Use account tool",
        "tools": ["toolIds": ["tool_missing_flow_validation_docs_example"]]
      ],
      "name": "Agent Step",
      "type": "prompt"
    ]
  ],
  "name": "Flow Validation Auth Context Example"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/public/flows/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Validate Flow (Public)

**Request**

```json
{
  "flowSteps": [
    {
      "config": {
        "model": "gpt-5-mini",
        "outputVariable": "summary",
        "text": "Write a concise summary for {{input}}"
      },
      "name": "Draft Response",
      "type": "prompt"
    }
  ],
  "name": "Flow Validation Public Example"
}
```

**Response**

```json
{
  "context": {
    "accountChecksPerformed": true,
    "accountChecksSkipped": true,
    "authenticated": true
  },
  "errors": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ],
  "recommendations": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ],
  "valid": true,
  "warnings": [
    {
      "code": "string",
      "message": "string",
      "path": "string",
      "step": {
        "index": 1,
        "name": "string",
        "type": "string"
      }
    }
  ]
}
```

**SDK Code**

```python Validate Flow (Public)
import requests

url = "https://api.runtype.com/v1/public/flows/validate"

payload = {
    "flowSteps": [
        {
            "config": {
                "model": "gpt-5-mini",
                "outputVariable": "summary",
                "text": "Write a concise summary for {{input}}"
            },
            "name": "Draft Response",
            "type": "prompt"
        }
    ],
    "name": "Flow Validation Public Example"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Validate Flow (Public)
const url = 'https://api.runtype.com/v1/public/flows/validate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"flowSteps":[{"config":{"model":"gpt-5-mini","outputVariable":"summary","text":"Write a concise summary for {{input}}"},"name":"Draft Response","type":"prompt"}],"name":"Flow Validation Public Example"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Validate Flow (Public)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.runtype.com/v1/public/flows/validate"

	payload := strings.NewReader("{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"outputVariable\": \"summary\",\n        \"text\": \"Write a concise summary for {{input}}\"\n      },\n      \"name\": \"Draft Response\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Public Example\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Validate Flow (Public)
require 'uri'
require 'net/http'

url = URI("https://api.runtype.com/v1/public/flows/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"outputVariable\": \"summary\",\n        \"text\": \"Write a concise summary for {{input}}\"\n      },\n      \"name\": \"Draft Response\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Public Example\"\n}"

response = http.request(request)
puts response.read_body
```

```java Validate Flow (Public)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.runtype.com/v1/public/flows/validate")
  .header("Content-Type", "application/json")
  .body("{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"outputVariable\": \"summary\",\n        \"text\": \"Write a concise summary for {{input}}\"\n      },\n      \"name\": \"Draft Response\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Public Example\"\n}")
  .asString();
```

```php Validate Flow (Public)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.runtype.com/v1/public/flows/validate', [
  'body' => '{
  "flowSteps": [
    {
      "config": {
        "model": "gpt-5-mini",
        "outputVariable": "summary",
        "text": "Write a concise summary for {{input}}"
      },
      "name": "Draft Response",
      "type": "prompt"
    }
  ],
  "name": "Flow Validation Public Example"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Validate Flow (Public)
using RestSharp;

var client = new RestClient("https://api.runtype.com/v1/public/flows/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"flowSteps\": [\n    {\n      \"config\": {\n        \"model\": \"gpt-5-mini\",\n        \"outputVariable\": \"summary\",\n        \"text\": \"Write a concise summary for {{input}}\"\n      },\n      \"name\": \"Draft Response\",\n      \"type\": \"prompt\"\n    }\n  ],\n  \"name\": \"Flow Validation Public Example\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Validate Flow (Public)
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "flowSteps": [
    [
      "config": [
        "model": "gpt-5-mini",
        "outputVariable": "summary",
        "text": "Write a concise summary for {{input}}"
      ],
      "name": "Draft Response",
      "type": "prompt"
    ]
  ],
  "name": "Flow Validation Public Example"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.runtype.com/v1/public/flows/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```