Update Flow Enrollment Candidates Custom Variables
curl --request POST \
--url https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_custom_variables \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"flowPlanId": "<string>",
"items": [
{
"candidateId": "<string>",
"customVariables": {},
"keys": [
"<string>"
]
}
]
}
'import requests
url = "https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_custom_variables"
payload = {
"flowPlanId": "<string>",
"items": [
{
"candidateId": "<string>",
"customVariables": {},
"keys": ["<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>',
items: [{candidateId: '<string>', customVariables: {}, keys: ['<string>']}]
})
};
fetch('https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_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_candidates_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>',
'items' => [
[
'candidateId' => '<string>',
'customVariables' => [
],
'keys' => [
'<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_candidates_custom_variables"
payload := strings.NewReader("{\n \"flowPlanId\": \"<string>\",\n \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\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_candidates_custom_variables")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowPlanId\": \"<string>\",\n \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_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 \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": [
"<string>"
],
"failed": [
{
"candidateId": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"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"
}
}Enrollments
Update Flow Enrollment Candidates Custom Variables
Requires the admin team role or global admin access. Check get_current_user.toolAccess before calling.
Updates saved inputs for 1 to 100 unique enrollment candidates in the current team and the specified flowPlanId.
Detailed usage guidance
- One type applies to all items: upsert adds or overwrites supplied customVariables while preserving all other keys; remove deletes supplied keys, with missing keys a no-op.
- Each candidate commits independently; returns updated ids and failed items with candidateId, code, and actionable message.
- Malformed shapes or duplicate ids reject the whole request before any updates.
- Allowed only while Awaiting, before enrollment is requested or created.
- Upsert values for keys with current flow definitions must match their declared types; unknown keys and incomplete required inputs are allowed during preparation.
- The final dictionary supports up to 20 values, strings up to 10000 characters, 20 KiB total; values must be strings without curly braces, integers, or booleans.
- Does not modify audience contacts, definitions, or existing enrollment snapshots and does not enroll candidates.
- Failure codes: candidate_not_found, candidate_flow_mismatch, candidate_not_editable, custom_variables_invalid, custom_variables_limit_exceeded, candidate_changed.
- Reload get_flow_candidate before retrying candidate_changed.
POST
/
api
/
public
/
tools
/
update_flow_candidates_custom_variables
Update Flow Enrollment Candidates Custom Variables
curl --request POST \
--url https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_custom_variables \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"flowPlanId": "<string>",
"items": [
{
"candidateId": "<string>",
"customVariables": {},
"keys": [
"<string>"
]
}
]
}
'import requests
url = "https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_custom_variables"
payload = {
"flowPlanId": "<string>",
"items": [
{
"candidateId": "<string>",
"customVariables": {},
"keys": ["<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>',
items: [{candidateId: '<string>', customVariables: {}, keys: ['<string>']}]
})
};
fetch('https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_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_candidates_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>',
'items' => [
[
'candidateId' => '<string>',
'customVariables' => [
],
'keys' => [
'<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_candidates_custom_variables"
payload := strings.NewReader("{\n \"flowPlanId\": \"<string>\",\n \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\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_candidates_custom_variables")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flowPlanId\": \"<string>\",\n \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.firsttouch.ai/api/public/tools/update_flow_candidates_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 \"items\": [\n {\n \"candidateId\": \"<string>\",\n \"customVariables\": {},\n \"keys\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"updated": [
"<string>"
],
"failed": [
{
"candidateId": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}{
"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