Run script
POST
Run script

Authorizations

Authorization
string
header
required

Voiceflow bearer token

Query Parameters

projectID
string
required

The ID of the project to operate on.

environmentAlias
string
required

The alias of the environment to operate on (e.g. main).

Body

messages
object[]
required

The user messages to send, in order, after the launch. A message is typed text, as a string or { "text": "…" }, or a button press, as { "button": "<label>" }, for a button the reply before offered. The digest shows offered buttons as "[buttons: Yes | No]".

variables
object

Variable values to set before the launch, keyed by variable name, to start as a known caller. Next to messages, not inside launch.

version
enum<string>
default:"draft"

Whether to talk to the draft or the published version of the environment. Draft unless you pass it.

Available options: draft, published
launch
object

How the conversation starts; payload is its only field. Leave it out for a plain launch.

userID
string

The conversation user ID to run as; the agent reads it as the user_id variable. Use it when the agent expects a caller ID of a known shape, such as a phone number, and make one up: never a real customer's ID. Draft version only. Leave it out to run as a new user each time. A reused ID keeps the variables an earlier conversation with it left.

Response

200 - application/json

Returns one digest per turn: the agent's replies, the tools it called, the variables that changed, and any errors. Messages that were not sent because the script stopped early come back in notSent, and needsRecompile says whether the turns ran against an outdated compile.

userID
string
required

The conversation user ID the script ran as, for reading its state afterwards.

transcriptID
string
required

The transcript this conversation is saved to, for reading its logs. Null when the runtime reported none, for example when the project does not save test conversations; then search transcripts with sessionID set to userID.

needsRecompile
boolean
required

When true, the script ran against a stale prototype. Compile the environment and run it again; do not treat these turns as proof the latest edits work.

turns
object[]
required

The launch turn first, then one turn per message sent.

notSent
string[]
required

Steps that were not run, in the same form as user, because the conversation ended, a send failed, a button was not on offer, the runtime logged an error outside a tool or a fatal error, the credit limit was reached, or the caller stopped the script first. A failed tool or HTTP call does not stop the script: it is listed in its turn.

Use the up and down arrow keys to select a result, Enter to open it, and Escape to close the search.