Endpoint
GET
/v1/stable/function

Returns every function in the environment. A function is custom JavaScript that runs in Voiceflow’s sandbox and returns through a named path. The call takes no paging parameters, so one request yields the whole set.

Request
Response

Authentication

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

Response

200 - application/json

Returns every function saved in the project's environment, each with its name, description, settings, and full JavaScript source code.

functions
object[]
required
StableFunction — see its attributes above
Endpoint
POST
/v1/stable/function

Adds a function to the environment, custom JavaScript that runs in Voiceflow’s sandbox and returns through a named path. The response carries the ID that later calls address it by.

Request
Response

Authentication

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

Request body

name
string
required
code
string
required

The JavaScript source code executed when the function runs.

Maximum length: 1048576
settings
object
description
string

A human-readable description of what the function does.

Response

201 - application/json

Creates the function and returns it in full, including its new ID and the JavaScript source stored for it.

function
object
required
StableFunction — see its attributes above
Endpoint
POST
/v1/stable/function/batch

Adds several functions to the environment in one request, each taking the fields the single-create call takes. The response carries the created functions in the same shape the list call returns.

Request
Response

Authentication

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

Request body

functions
object[]
required
StableFunctionCreateRequest — see its attributes above

Response

201 - application/json

Creates every function in the request and returns them all, each with its own ID, stored JavaScript source, and exit path order.

functions
object[]
required
StableFunction — see its attributes above
Endpoint
GET
/v1/stable/function/{functionID}

Returns a single function by ID, with the fields that define it. A function is custom JavaScript that runs in Voiceflow’s sandbox and returns through a named path.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

The ID of the function to operate on.

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

Response

200 - application/json

Returns a single function, including the JavaScript source that runs when it is called and the ordered list of path IDs that controls the display order of its exit paths.

function
object
required
StableFunction — see its attributes above
Endpoint
PATCH
/v1/stable/function/{functionID}

Changes an existing function in place. The response carries only a confirmation message, so refetch the function to read its new values.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

The ID of the function to operate on.

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

Request body

name
string
code
string

The JavaScript source code executed when the function runs.

Maximum length: 1048576
settings
object
pathOrder
string[]

An ordered list of path IDs controlling the display order of the function's exit paths.

description
string

A human-readable description of what the function does.

Response

200 - application/json

Confirms the function was updated. Only a message is returned, not the revised function, so fetch the function again to read back its saved code.

message
string
required

A human-readable message confirming the update.

Endpoint
DELETE
/v1/stable/function/{functionID}

Deletes a single function by ID. A function is custom JavaScript that runs in Voiceflow’s sandbox and returns through a named path. The response carries only a confirmation message, so refetch the functions to see what is left.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

The ID of the function to operate on.

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

Response

200 - application/json

Confirms the function was deleted. The response is a message, not the removed function, so its JavaScript source is not recoverable from this call.

message
string
required

A human-readable message confirming the deletion.

Endpoint
GET
/v1/stable/function/{functionID}/schema

Returns what a function takes and gives back: its input variables, its output variables, and its exit paths, read from the environment's draft. Call it before executing to learn the input names.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

The ID of the function whose schema to read.

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

Response

200 - application/json

Returns the function's inputs, output variables, and exit path names.

inputs
object[]
required

The inputs execute takes, one per input variable, sorted by name. Every one is a required string.

StableExecuteInput — see its attributes above
outputs
object[]
required

The output variables the function may return, sorted by name.

StableFunctionSchemaOutput — see its attributes above
paths
string[]
required

The exit path names the function may return with next: { path }, in path order.

Use this operation to test agent behavior or execute tools with controlled inputs. For production conversation integrations, use the Agent runtime. Tool execution can affect connected services.
Endpoint
POST
/v1/stable/function/{functionID}/execute

Runs the saved draft of a function once with the inputs in the body, without compiling the agent or starting a conversation. The run stops at the function's timeout or 18 seconds, whichever is shorter, and nothing is saved.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

The ID of the function to execute.

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

Request body

inputs
object

A value for each of the function's input variables, keyed by input name. Every declared input needs a value, and a name the function does not declare is refused. List them with get_schema.

Response

200 - application/json

Returns the function's output variables, the exit path it chose, and the traces it emitted, with success, latencyMs, and error fields.

success
boolean
required

Whether the tool ran and reported no error.

latencyMs
number
required

How long the run took, in milliseconds, measured by this API around the call.

error
string
required

Why the run failed when success is false, otherwise null. Secret values read [secret].

truncated
boolean
required

Whether a returned payload was over 64 KB and was cut to its first 64 KB of JSON text, which then arrives as a string.

output
object
required

What the function returned, on failure too. Null only when general-runtime did not answer in time.

Endpoint
POST
/v1/stable/function/{functionID}/check

Run a function's saved code on test cases and compare the results.

Request
Response

Authentication

Authorization
string
header
required

Voiceflow bearer token

Path parameters

functionID
string
required

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

Request body

cases
object[]
required
Minimum items: 1 · Maximum items: 12

Response

200 - application/json

Schemas

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