curl --request POST \
--url https://api.goyappr.com/agents/{id}/flow/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transcript": [
{
"text": "<string>"
}
],
"mock_tool_results": {}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/flow/test"
payload = {
"transcript": [{ "text": "<string>" }],
"mock_tool_results": {}
}
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({transcript: [{text: '<string>'}], mock_tool_results: {}})
};
fetch('https://api.goyappr.com/agents/{id}/flow/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://api.goyappr.com/agents/{id}/flow/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([
'transcript' => [
[
'text' => '<string>'
]
],
'mock_tool_results' => [
]
]),
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://api.goyappr.com/agents/{id}/flow/test"
payload := strings.NewReader("{\n \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\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://api.goyappr.com/agents/{id}/flow/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/flow/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 \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\n}"
response = http.request(request)
puts response.read_body{
"trace": [
{
"step_id": "<string>",
"kind": "enter",
"decision": "<string>",
"reason": "<string>",
"data": {}
}
],
"named_results": {},
"slot_values": {},
"ended_at_step_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "WORKFLOW_FLOW_TEST_UNSUPPORTED",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}Test a Flow
For agents of the retired flow kind only: a workflow agent is refused with 409, and rehearsing one needs a browser or a Web SDK client. Walks a flow graph against a synthetic transcript without dispatching real tools or writing a call_logs row. Conversation-node transitions are picked by a deterministic keyword heuristic — for true eval-LLM-driven simulation use the in-app test panel. Tool-call nodes consume mocked results from the request body. Useful for CI smoke tests and skill verification before going live.
curl --request POST \
--url https://api.goyappr.com/agents/{id}/flow/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transcript": [
{
"text": "<string>"
}
],
"mock_tool_results": {}
}
'import requests
url = "https://api.goyappr.com/agents/{id}/flow/test"
payload = {
"transcript": [{ "text": "<string>" }],
"mock_tool_results": {}
}
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({transcript: [{text: '<string>'}], mock_tool_results: {}})
};
fetch('https://api.goyappr.com/agents/{id}/flow/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://api.goyappr.com/agents/{id}/flow/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([
'transcript' => [
[
'text' => '<string>'
]
],
'mock_tool_results' => [
]
]),
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://api.goyappr.com/agents/{id}/flow/test"
payload := strings.NewReader("{\n \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\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://api.goyappr.com/agents/{id}/flow/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.goyappr.com/agents/{id}/flow/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 \"transcript\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"mock_tool_results\": {}\n}"
response = http.request(request)
puts response.read_body{
"trace": [
{
"step_id": "<string>",
"kind": "enter",
"decision": "<string>",
"reason": "<string>",
"data": {}
}
],
"named_results": {},
"slot_values": {},
"ended_at_step_id": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}{
"error": "<string>",
"code": "WORKFLOW_FLOW_TEST_UNSUPPORTED",
"issues": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>"
}
]
}POST /agents creates today — is refused with 409 WORKFLOW_FLOW_TEST_UNSUPPORTED. There is no text-only rehearsal of a workflow over the API: the only way to watch a workflow’s analysis and follow-ups run before going live is a real conversation, through POST /calls {"type":"web"} and a page using @goyappr/client, a shared link, or the agent’s Test tab in the dashboard. When that call ends, GET /calls/{id} shows its analysis, follow_ups and execution.flow_config graph against a synthetic transcript without dispatching real tools, writing a call_logs row, or placing a real call. Useful for CI smoke tests, skill verification, and pre-deploy sanity checks.
Required scope: flows:test (separate from agents:update because flow tests can spend money on eval LLMs and external APIs in richer test modes).
Workflow agents cannot be tested here
This endpoint walks a legacyflow_config graph. A workflow agent — anything you create today with POST /agents — has no such graph, so it answers 409 WORKFLOW_FLOW_TEST_UNSUPPORTED and nothing runs. It says so before it reads the body: a request with no body, or one that is not JSON, gets the same 409, not a 400 about the body (an agent that is not there is a 404 first).
{
"error": "Rehearsing a workflow agent needs a browser or a Web SDK client. This simulator walks only the retired flow graphs, and there is no text-only rehearsal of a workflow over the API. Mint a browser session with POST /calls {\"type\":\"web\"} and connect to it from a page with @goyappr/client, or send a person a shared link (POST /shared-links) to call it from. When the call ends, GET /calls/{id} shows its analysis and follow-ups.",
"code": "WORKFLOW_FLOW_TEST_UNSUPPORTED"
}
POST /callswith"type": "web"returns a single-use session token and the URLs your own page connects to with@goyappr/client. The call is a real one — it is transcribed, analysed, runs the workflow’s follow-ups, and appears inGET /calls.POST /shared-linksreturns a page anyone can open and talk to the agent from, with no key and no code of your own.
POST /agents/{id}/extraction/dry-run reads a transcript you send the way the post-call pass would, and POST /tools/{id}/test runs one tool. Neither runs the workflow’s follow-ups.
What this endpoint does
- Loads the agent’s saved
flow_config(or uses the override you supply in the request body). - For each conversation node: consumes the next
role: "user"turn from your transcript and picks a transition by deterministic keyword overlap with each transition’s label/description. Misses route to “stay”. - For each tool-call node: looks up
mock_tool_results[step_id]. Iferroris set, takes theerrortransition. Otherwise takessuccess, with custom branches evaluated in declaration order via thejsonpath/equalsrule. - At an end node (or transfer, or post-end webhook/structured_output), the walk terminates and returns the full trace.
- A transfer node’s
transfer_tomay be a phone number or a SIP address; the simulator never places the transfer, so it does not check that the call arrived over a SIP trunk.
What this endpoint does NOT do
- It does not call the eval LLM. The deterministic heuristic is good enough for unit tests of branching topology, not for testing prompt quality. For eval-LLM-driven simulation use the in-app Flow Test panel (which runs a real bot pipeline against a WebRTC web call).
- It does not dispatch tools. Mock every tool-call node you reach via
mock_tool_results. - It does not write
call_logsor fire webhooks.
Body
{
"transcript": [
{ "role": "user", "text": "I want to book for next Wednesday at 2pm" }
],
"mock_tool_results": {
"check-availability-step": {
"result": { "status": "available", "slot_id": "abc123" }
}
}
}
flow_config in the body to test an unsaved draft instead of the agent’s stored graph.
Response
{
"trace": [
{ "step_id": "start-1", "kind": "enter" },
{ "step_id": "start-1", "kind": "auto_advance", "decision": "ask-date-1" },
{ "step_id": "ask-date-1", "kind": "enter" },
{ "step_id": "ask-date-1", "kind": "eval", "decision": "tx-confirm", "reason": "heuristic match (overlap_score=2)" },
{ "step_id": "check-availability-step", "kind": "enter" },
{ "step_id": "check-availability-step", "kind": "tool_mock", "decision": "confirm-step", "reason": "success", "data": { "status": "available", "slot_id": "abc123" } },
{ "step_id": "end-1", "kind": "enter" },
{ "step_id": "end-1", "kind": "end" }
],
"named_results": { "Check Availability": { "status": "available", "slot_id": "abc123" } },
"slot_values": {},
"ended_at_step_id": "end-1"
}
Authorizations
Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).