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"

agentIds
string<uuid>[]
required

Agents this flow exercises. At least one is required.

Minimum array length: 1
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.

description
string | null
agentExpectations
object[]
branchingMode
enum<string>

DETERMINISTIC (the default) runs one variant per path through the graph; ADAPTIVE collapses the paths into one call the simulated customer adapts across.

Available options:
DETERMINISTIC,
ADAPTIVE

Response

The created customer flow

data
Scripted · object
required

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