curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"persist": true,
"data": {},
"sample_uuid": "<string>",
"limit": 10,
"input_data": {},
"config_override": {},
"dry_run": false,
"live": false
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test"
payload = {
"persist": True,
"data": {},
"sample_uuid": "<string>",
"limit": 10,
"input_data": {},
"config_override": {},
"dry_run": False,
"live": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
persist: true,
data: {},
sample_uuid: '<string>',
limit: 10,
input_data: {},
config_override: {},
dry_run: false,
live: false
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'persist' => true,
'data' => [
],
'sample_uuid' => '<string>',
'limit' => 10,
'input_data' => [
],
'config_override' => [
],
'dry_run' => false,
'live' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test"
payload := strings.NewReader("{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"kind": "trigger",
"dry_run": true,
"data": {},
"duration_ms": 123,
"resolved": {},
"selected": {},
"samples": [
{
"sample_uuid": "<string>",
"label": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"message": "Agent not found",
"data": []
}{
"success": false,
"message": "Agent not found",
"data": []
}{
"success": false,
"message": "Agent not found",
"data": []
}Test a step — kind-aware behavior (trigger samples vs action exec)
For trigger steps: auto-fetches recent records from the trigger’s source (e.g. recent calls for Calls/call_started) and uses the latest as the persisted sample. The chosen sample’s data is what every downstream step’s {{stepN.field}} resolves against. Pass data: {...} to skip the auto-fetch and use a manual payload. Pass sample_uuid to pick a specific record from samples[]. Returns 404 with samples:[] if the source has no matching records — the MCP should then prompt the user to either generate a real event or supply manual data.
For action steps: resolves the step’s config against upstream last_test.data, then either dry-runs (validates config without external calls) or executes live. Default behavior uses a safe-list — read-only actions execute live, destructive actions (post message, create record) dry-run. Pass live: true to force real execution; pass dry_run: true to force validation-only. Call actions (end_call, transfer_call) always dry-run since they need a live call’s control_url.
Side effect on success when persist=true: step status flips from draft → active (this is what unlocks POST /deploy).
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"persist": true,
"data": {},
"sample_uuid": "<string>",
"limit": 10,
"input_data": {},
"config_override": {},
"dry_run": false,
"live": false
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test"
payload = {
"persist": True,
"data": {},
"sample_uuid": "<string>",
"limit": 10,
"input_data": {},
"config_override": {},
"dry_run": False,
"live": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
persist: true,
data: {},
sample_uuid: '<string>',
limit: 10,
input_data: {},
config_override: {},
dry_run: false,
live: false
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'persist' => true,
'data' => [
],
'sample_uuid' => '<string>',
'limit' => 10,
'input_data' => [
],
'config_override' => [
],
'dry_run' => false,
'live' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test"
payload := strings.NewReader("{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/flow/{uuid}/steps/{step}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"persist\": true,\n \"data\": {},\n \"sample_uuid\": \"<string>\",\n \"limit\": 10,\n \"input_data\": {},\n \"config_override\": {},\n \"dry_run\": false,\n \"live\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"kind": "trigger",
"dry_run": true,
"data": {},
"duration_ms": 123,
"resolved": {},
"selected": {},
"samples": [
{
"sample_uuid": "<string>",
"label": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}
]
}
}{
"success": false,
"message": "Agent not found",
"data": []
}{
"success": false,
"message": "Agent not found",
"data": []
}{
"success": false,
"message": "Agent not found",
"data": []
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Body
Save the result to step.last_test and activate the step. Set false to test without committing.
(triggers) Manual sample payload. When set, skips auto-fetch and persists this object as test_data.
(triggers) Pick a specific record from the auto-fetched list.
(triggers) Max samples to return.
x <= 50(actions) Override the upstream {{stepN.…}} resolution. Useful to test with hypothetical input.
(actions) Test with a config different from step.config (does not persist).
(actions) Force dry-run even for normally-live actions.
(actions) Force real execution. Bypasses the safe-list — destructive sends/writes will actually go through to the third party.
