Voiceflow bearer token
curl --request POST \
--url https://realtime-api.voiceflow.com/v1/stable/function \
--header 'Authorization: Bearer <token>'
--header 'Content-Type: application/json' \
--data '{
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
}'const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/function?projectID=<projectID>&environmentAlias=<environmentAlias>', {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
'https://realtime-api.voiceflow.com/v1/stable/function?projectID=<projectID>&environmentAlias=<environmentAlias>',
headers={'Authorization': 'Bearer <token>'},
json={
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
},
)
data = response.json()vf function create --project-id <projectID> --environment-alias <environmentAlias> \
< body.json{
"function": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"image": "<string>",
"settings": {
"timeoutMs": 0
},
"createdAt": "2026-09-10T00:00:00.000Z",
"updatedAt": "2026-09-10T00:00:00.000Z",
"pathOrder": [
"<string>"
],
"description": "<string>"
}
}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.
Paste in your agent
1. Set up Voiceflow by following https://www.voiceflow.com/agents/setup 2. Read https://www.voiceflow.com/docs/api-reference/function/create-function.md — the Voiceflow documentation page "Create function". Use it to help me with this part of Voiceflow and answer my questions. Refer to https://www.voiceflow.com/docs/llms.txt if you need related documentation.
curl --request POST \
--url https://realtime-api.voiceflow.com/v1/stable/function \
--header 'Authorization: Bearer <token>'
--header 'Content-Type: application/json' \
--data '{
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
}'const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/function?projectID=<projectID>&environmentAlias=<environmentAlias>', {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
'https://realtime-api.voiceflow.com/v1/stable/function?projectID=<projectID>&environmentAlias=<environmentAlias>',
headers={'Authorization': 'Bearer <token>'},
json={
"name": "<string>",
"code": "<string>",
"settings": {
"timeoutMs": 0
},
"description": "<string>"
},
)
data = response.json()vf function create --project-id <projectID> --environment-alias <environmentAlias> \
< body.json{
"function": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"image": "<string>",
"settings": {
"timeoutMs": 0
},
"createdAt": "2026-09-10T00:00:00.000Z",
"updatedAt": "2026-09-10T00:00:00.000Z",
"pathOrder": [
"<string>"
],
"description": "<string>"
}
}Authorizations
Query Parameters
Body
Response
201 - application/jsonCreates the function and returns it in full, including its new ID and the JavaScript source stored for it.
Show child attributes
Was this page helpful?
Thanks for your feedback.