Update Flow Custom Variables
curl --request POST \
--url https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"flowPlanId": "<string>",
"changes": {
"add": [
{
"name": "<string>",
"label": "<string>"
}
],
"updateLabels": [
{
"name": "<string>",
"label": "<string>"
}
],
"remove": [
"<string>"
]
}
}
'import requests
url = "https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables"
payload = {
"flowPlanId": "<string>",
"changes": {
"add": [
{
"name": "<string>",
"label": "<string>"
}
],
"updateLabels": [
{
"name": "<string>",
"label": "<string>"
}
],
"remove": ["<string>"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flowPlanId: '<string>',
changes: {
add: [{name: '<string>', label: '<string>'}],
updateLabels: [{name: '<string>', label: '<string>'}],
remove: ['<string>']
}
})
};
fetch('https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables', 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://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flowPlanId' => '<string>',
'changes' => [
'add' => [
[
'name' => '<string>',
'label' => '<string>'
]
],
'updateLabels' => [
[
'name' => '<string>',
'label' => '<string>'
]
],
'remove' => [
'<string>'
]
]
]),
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://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables"
payload := strings.NewReader("{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"label": "<string>",
"type": "integer",
"referencePaths": [
"<string>"
],
"isUsed": true,
"canDelete": true
}
]{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}Flow Plans
Update Flow Custom Variables
Requires the admin team role or global admin access. Check get_current_user.toolAccess before calling.
Updates custom input definitions atomically through add, updateLabels, and remove.
Detailed usage guidance
- Read get_flow_workspace.customVariables first for definitions, isUsed, canDelete, and referencePaths.
- Each name may appear only once across all operations; overlapping or duplicate names are rejected.
- Add requires a new name, updateLabels and remove require existing names.
- Name and type cannot change; removal requires no references in the current tree, including branch expressions.
- The final list supports up to 20 definitions.
- Any invalid operation rejects the entire batch.
- Preserves publication state, tree, saved audience/candidate values, and existing enrollment snapshots.
- Returns all definitions and current usage.
- If a concurrent edit conflicts, reload the workspace before retrying.
POST
/
api
/
public
/
tools
/
update_flow_custom_variables
Update Flow Custom Variables
curl --request POST \
--url https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"flowPlanId": "<string>",
"changes": {
"add": [
{
"name": "<string>",
"label": "<string>"
}
],
"updateLabels": [
{
"name": "<string>",
"label": "<string>"
}
],
"remove": [
"<string>"
]
}
}
'import requests
url = "https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables"
payload = {
"flowPlanId": "<string>",
"changes": {
"add": [
{
"name": "<string>",
"label": "<string>"
}
],
"updateLabels": [
{
"name": "<string>",
"label": "<string>"
}
],
"remove": ["<string>"]
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flowPlanId: '<string>',
changes: {
add: [{name: '<string>', label: '<string>'}],
updateLabels: [{name: '<string>', label: '<string>'}],
remove: ['<string>']
}
})
};
fetch('https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables', 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://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flowPlanId' => '<string>',
'changes' => [
'add' => [
[
'name' => '<string>',
'label' => '<string>'
]
],
'updateLabels' => [
[
'name' => '<string>',
'label' => '<string>'
]
],
'remove' => [
'<string>'
]
]
]),
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://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables"
payload := strings.NewReader("{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.firsttouch.ai/api/public/tools/update_flow_custom_variables")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flowPlanId\": \"<string>\",\n \"changes\": {\n \"add\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"updateLabels\": [\n {\n \"name\": \"<string>\",\n \"label\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"label": "<string>",
"type": "integer",
"referencePaths": [
"<string>"
],
"isUsed": true,
"canDelete": true
}
]{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}{
"error": "<string>",
"message": "<string>",
"traceId": "<string>",
"details": {
"currentStatus": "pending"
}
}Body
application/json