curl --request POST \
--url https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean",
"description": "Set true when contact passes US adult eligibility checks",
"type": "contact",
"sectionType": "identity"
}
'import requests
url = "https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields"
payload = {
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean",
"description": "Set true when contact passes US adult eligibility checks",
"type": "contact",
"sectionType": "identity"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Eligibility flag',
sectionId: 'contact.identity',
expression: 'contact.age >= 18 && contact.country == "US"',
status: 'active',
outputType: 'boolean',
description: 'Set true when contact passes US adult eligibility checks',
type: 'contact',
sectionType: 'identity'
})
};
fetch('https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields', 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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields",
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([
'name' => 'Eligibility flag',
'sectionId' => 'contact.identity',
'expression' => 'contact.age >= 18 && contact.country == "US"',
'status' => 'active',
'outputType' => 'boolean',
'description' => 'Set true when contact passes US adult eligibility checks',
'type' => 'contact',
'sectionType' => 'identity'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields"
payload := strings.NewReader("{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "66d0a0b0c0d0e0f0a0b0c0d0",
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean"
}{
"error": "Expression validation failed",
"diagnostics": {
"issues": [
{
"message": "Unknown field `contact.country2`",
"line": 1,
"column": 22
}
]
}
}{
"error": "Expression validation failed",
"diagnostics": {
"issues": [
{
"message": "Unknown field `contact.country2`",
"line": 1,
"column": 22
}
]
}
}Create a conditional field
Create a derived (“conditional”) field whose value is computed from an expression over other fields in the section. The expression is validated before persistence.
curl --request POST \
--url https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean",
"description": "Set true when contact passes US adult eligibility checks",
"type": "contact",
"sectionType": "identity"
}
'import requests
url = "https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields"
payload = {
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean",
"description": "Set true when contact passes US adult eligibility checks",
"type": "contact",
"sectionType": "identity"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Eligibility flag',
sectionId: 'contact.identity',
expression: 'contact.age >= 18 && contact.country == "US"',
status: 'active',
outputType: 'boolean',
description: 'Set true when contact passes US adult eligibility checks',
type: 'contact',
sectionType: 'identity'
})
};
fetch('https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields', 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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields",
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([
'name' => 'Eligibility flag',
'sectionId' => 'contact.identity',
'expression' => 'contact.age >= 18 && contact.country == "US"',
'status' => 'active',
'outputType' => 'boolean',
'description' => 'Set true when contact passes US adult eligibility checks',
'type' => 'contact',
'sectionType' => 'identity'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields"
payload := strings.NewReader("{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://your-instance.example.com/api/organizations/{organizationId}/conditional-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Eligibility flag\",\n \"sectionId\": \"contact.identity\",\n \"expression\": \"contact.age >= 18 && contact.country == \\\"US\\\"\",\n \"status\": \"active\",\n \"outputType\": \"boolean\",\n \"description\": \"Set true when contact passes US adult eligibility checks\",\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "66d0a0b0c0d0e0f0a0b0c0d0",
"name": "Eligibility flag",
"sectionId": "contact.identity",
"expression": "contact.age >= 18 && contact.country == \"US\"",
"status": "active",
"outputType": "boolean"
}{
"error": "Expression validation failed",
"diagnostics": {
"issues": [
{
"message": "Unknown field `contact.country2`",
"line": 1,
"column": 22
}
]
}
}{
"error": "Expression validation failed",
"diagnostics": {
"issues": [
{
"message": "Unknown field `contact.country2`",
"line": 1,
"column": 22
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Display name of the conditional field; shown in catalogs and UI.
Catalog section the field belongs to (e.g. contact.identity).
Evaluator expression (e.g. contact.age >= 18 && contact.country == "US"). Validated against the catalog on save.
Lifecycle state of the field, typically active or draft.
Type returned by the expression: boolean, string, number.
Free-form explanation of the field's intent; shown as helper text.
Top-level scope the field applies to (e.g. contact, application).
Where the field is surfaced (contact, application, etc.).
Response
Field created
The response is of type object.