Update flow
PATCH
/
v1
/
agents
/
{agentId}
/
branches
/
{branchId}
/
flows
/
{flowId}
Update flow
curl --request PATCH \
--url https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"conditions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": [
"<string>"
]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}
'import requests
url = "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}"
payload = {
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"conditions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": ["<string>"]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
startStepId: '<string>',
steps: [
{
id: '<string>',
name: '<string>',
prompt: '<string>',
conditions: [
{
id: '<string>',
label: '<string>',
description: '<string>',
childStepId: '<string>',
requiredEntities: ['<string>']
}
],
references: {
entities: {},
attributes: {},
variables: {},
extractedEntities: {},
transitionFunctions: {},
globalFunctions: {},
sms: {},
handoff: {}
}
}
],
transitionFunctions: [
{
id: '<string>',
name: '<string>',
code: '<string>',
description: '<string>',
parameters: [{id: '<string>', name: '<string>', type: '<string>', description: '<string>'}],
references: {flowSteps: {}, variables: {}}
}
]
})
};
fetch('https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'startStepId' => '<string>',
'steps' => [
[
'id' => '<string>',
'name' => '<string>',
'prompt' => '<string>',
'conditions' => [
[
'id' => '<string>',
'label' => '<string>',
'description' => '<string>',
'childStepId' => '<string>',
'requiredEntities' => [
'<string>'
]
]
],
'references' => [
'entities' => [
],
'attributes' => [
],
'variables' => [
],
'extractedEntities' => [
],
'transitionFunctions' => [
],
'globalFunctions' => [
],
'sms' => [
],
'handoff' => [
]
]
]
],
'transitionFunctions' => [
[
'id' => '<string>',
'name' => '<string>',
'code' => '<string>',
'description' => '<string>',
'parameters' => [
[
'id' => '<string>',
'name' => '<string>',
'type' => '<string>',
'description' => '<string>'
]
],
'references' => [
'flowSteps' => [
],
'variables' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"type": "default_step",
"name": "<string>",
"prompt": "<string>",
"position": {
"x": 123,
"y": 123
},
"conditions": [
{
"id": "<string>",
"type": "exitFlowCondition",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": [
"<string>"
]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
},
"function": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"latencyControl": {
"enabled": true,
"randomize": true,
"initialDelay": 123,
"interval": 123
}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}Authorizations
Body
application/json
Minimum string length:
1Full replace semantics: when provided, this array becomes the complete set of the flow's steps — any existing step not included here is deleted. Omit the field entirely to leave steps untouched. Each step's own conditions field follows the same rule at the step level: omitted preserves the existing conditions on that step, while [] deletes all of that step's conditions.
Show child attributes
Show child attributes
Full replace semantics: when provided, this array becomes the complete set of the flow's transition functions — any existing transition function not included here is deleted. Omit the field entirely to leave transition functions untouched.
Show child attributes
Show child attributes
Last modified on November 4, 2026
Was this page helpful?
⌘I
Update flow
curl --request PATCH \
--url https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"conditions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": [
"<string>"
]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}
'import requests
url = "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}"
payload = {
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"conditions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": ["<string>"]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
startStepId: '<string>',
steps: [
{
id: '<string>',
name: '<string>',
prompt: '<string>',
conditions: [
{
id: '<string>',
label: '<string>',
description: '<string>',
childStepId: '<string>',
requiredEntities: ['<string>']
}
],
references: {
entities: {},
attributes: {},
variables: {},
extractedEntities: {},
transitionFunctions: {},
globalFunctions: {},
sms: {},
handoff: {}
}
}
],
transitionFunctions: [
{
id: '<string>',
name: '<string>',
code: '<string>',
description: '<string>',
parameters: [{id: '<string>', name: '<string>', type: '<string>', description: '<string>'}],
references: {flowSteps: {}, variables: {}}
}
]
})
};
fetch('https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'startStepId' => '<string>',
'steps' => [
[
'id' => '<string>',
'name' => '<string>',
'prompt' => '<string>',
'conditions' => [
[
'id' => '<string>',
'label' => '<string>',
'description' => '<string>',
'childStepId' => '<string>',
'requiredEntities' => [
'<string>'
]
]
],
'references' => [
'entities' => [
],
'attributes' => [
],
'variables' => [
],
'extractedEntities' => [
],
'transitionFunctions' => [
],
'globalFunctions' => [
],
'sms' => [
],
'handoff' => [
]
]
]
],
'transitionFunctions' => [
[
'id' => '<string>',
'name' => '<string>',
'code' => '<string>',
'description' => '<string>',
'parameters' => [
[
'id' => '<string>',
'name' => '<string>',
'type' => '<string>',
'description' => '<string>'
]
],
'references' => [
'flowSteps' => [
],
'variables' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.poly.ai/v1/agents/{agentId}/branches/{branchId}/flows/{flowId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"startStepId\": \"<string>\",\n \"steps\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"conditions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"description\": \"<string>\",\n \"childStepId\": \"<string>\",\n \"requiredEntities\": [\n \"<string>\"\n ]\n }\n ],\n \"references\": {\n \"entities\": {},\n \"attributes\": {},\n \"variables\": {},\n \"extractedEntities\": {},\n \"transitionFunctions\": {},\n \"globalFunctions\": {},\n \"sms\": {},\n \"handoff\": {}\n }\n }\n ],\n \"transitionFunctions\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"parameters\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"type\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"references\": {\n \"flowSteps\": {},\n \"variables\": {}\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"startStepId": "<string>",
"steps": [
{
"id": "<string>",
"type": "default_step",
"name": "<string>",
"prompt": "<string>",
"position": {
"x": 123,
"y": 123
},
"conditions": [
{
"id": "<string>",
"type": "exitFlowCondition",
"label": "<string>",
"description": "<string>",
"childStepId": "<string>",
"requiredEntities": [
"<string>"
]
}
],
"references": {
"entities": {},
"attributes": {},
"variables": {},
"extractedEntities": {},
"transitionFunctions": {},
"globalFunctions": {},
"sms": {},
"handoff": {}
},
"function": {
"id": "<string>",
"name": "<string>",
"code": "<string>",
"latencyControl": {
"enabled": true,
"randomize": true,
"initialDelay": 123,
"interval": 123
}
}
}
],
"transitionFunctions": [
{
"id": "<string>",
"name": "<string>",
"code": "<string>",
"description": "<string>",
"parameters": [
{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
],
"references": {
"flowSteps": {},
"variables": {}
}
}
]
}
