Skip to main content
POST
Test a flow (hermetic simulator)
Rehearsing a workflow agent needs a browser or a Web SDK client. This endpoint only walks the retired flow graphs; a workflow agent — anything 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.
Hermetic flow simulator for agents of the retired flow kind. Walks a 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 legacy flow_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).
Two routes rehearse a workflow agent for real, both without a phone number, and both need a browser — the mint’s session is a WebRTC connection that only a browser (or another WebRTC client) can open:
  • POST /calls with "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 in GET /calls.
  • POST /shared-links returns a page anyone can open and talk to the agent from, with no key and no code of your own.
A server with no browser can still check pieces on their 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]. If error is set, takes the error transition. Otherwise takes success, with custom branches evaluated in declaration order via the jsonpath/equals rule.
  • 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_to may 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_logs or fire webhooks.

Body

Optionally include flow_config in the body to test an unsaved draft instead of the agent’s stored graph.

Response

Authorizations

Authorization
string
header
required

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).

Path Parameters

id
string<uuid>
required

Body

application/json
transcript
object[]
required
flow_config
object

Optional override. If omitted, uses the agent's saved flow_config.

mock_tool_results
object

Keyed by tool-call node id.

Response

Trace of nodes visited and decisions made

trace
object[]
named_results
object
slot_values
object
ended_at_step_id
string | null