Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for creating a customer flow. SCRIPTED writes the conversation out as a graph of turns; IMPROV gives the simulated customer a brief and lets it improvise.

type
string
required
Allowed value: "SCRIPTED"
title
string
required
Minimum string length: 1
Example:

"Reschedule an appointment"

graph
object[]
required

The conversation, as a graph of steps. At most 100 steps across at most 25 paths. The variants come from the graph: one per path, so they are not sent here.

Minimum array length: 1

One step in a scripted flow's conversation.

nodeId is the identity contract: include it to update the existing step, omit it to create a new one. A step continues into steps (more than one child is a branch point) and/or mergeIntoNodeIds, which names steps elsewhere in the same request that this step rejoins. Branches that come back together are represented that way rather than by repeating the shared step, so reading a flow, editing it and writing it back preserves it exactly.

A merge target is named by its nodeId when it already exists, or by ref when it is being created in the same request. ref is a label you choose, it is request-local, and it is never stored or returned. Put the shared step inline under the first branch that reaches it and point the others at it: a top-level step is a root wired straight from the start of the flow, so a merge target parked there would also be reachable directly.

The two DTMF types are mirror images and both require dtmfDigits. CUSTOMER_DTMF is keys the simulated caller presses while navigating your agent. AGENT_DTMF is keys your agent under test is expected to press while navigating a menu the simulation is playing, so its digits are an assertion the run is graded against rather than an instruction, and it counts as an agent turn for role alternation.

description
string | null
agentExpectations
object[]
agentIds
string<uuid>[]

Agents this flow exercises. Optional for scripted flows.

branchingMode
enum<string>

How a run walks the graph. DETERMINISTIC ("Simulate every path" in the app) places one call per variant, each following its path exactly whatever the agent says. ADAPTIVE ("Adapt to your agent") collapses the paths into one call PER PERSONA, on which the simulated customer picks a branch from what the agent actually said. Both modes speak the exact authored lines, and neither changes how metrics or expectations grade. (DETERMINISTIC is the default.)

Available options:
DETERMINISTIC,
ADAPTIVE

Response

The created customer flow

data
Scripted · object
required

The conversation a simulated customer has with the agent under test.