Reorder conditional fields
curl --request POST \
--url https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": [
"66d0a0b0c0d0e0f0a0b0c0d0",
"66d0a0b0c0d0e0f0a0b0c0d1"
],
"type": "contact",
"sectionType": "identity"
}
'import requests
url = "https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder"
payload = {
"order": ["66d0a0b0c0d0e0f0a0b0c0d0", "66d0a0b0c0d0e0f0a0b0c0d1"],
"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({
order: ['66d0a0b0c0d0e0f0a0b0c0d0', '66d0a0b0c0d0e0f0a0b0c0d1'],
type: 'contact',
sectionType: 'identity'
})
};
fetch('https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder', 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/reorder",
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([
'order' => [
'66d0a0b0c0d0e0f0a0b0c0d0',
'66d0a0b0c0d0e0f0a0b0c0d1'
],
'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/reorder"
payload := strings.NewReader("{\n \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\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/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\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/reorder")
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 \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_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
}
]
}
}ConditionalFields
Reorder conditional fields
Replace the ordering of conditional fields within a section. The order array must list every field id currently in scope; the new index is the position in the array.
POST
/
api
/
organizations
/
{organizationId}
/
conditional-fields
/
reorder
Reorder conditional fields
curl --request POST \
--url https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"order": [
"66d0a0b0c0d0e0f0a0b0c0d0",
"66d0a0b0c0d0e0f0a0b0c0d1"
],
"type": "contact",
"sectionType": "identity"
}
'import requests
url = "https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder"
payload = {
"order": ["66d0a0b0c0d0e0f0a0b0c0d0", "66d0a0b0c0d0e0f0a0b0c0d1"],
"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({
order: ['66d0a0b0c0d0e0f0a0b0c0d0', '66d0a0b0c0d0e0f0a0b0c0d1'],
type: 'contact',
sectionType: 'identity'
})
};
fetch('https://your-instance.example.com/api/organizations/{organizationId}/conditional-fields/reorder', 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/reorder",
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([
'order' => [
'66d0a0b0c0d0e0f0a0b0c0d0',
'66d0a0b0c0d0e0f0a0b0c0d1'
],
'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/reorder"
payload := strings.NewReader("{\n \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\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/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\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/reorder")
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 \"order\": [\n \"66d0a0b0c0d0e0f0a0b0c0d0\",\n \"66d0a0b0c0d0e0f0a0b0c0d1\"\n ],\n \"type\": \"contact\",\n \"sectionType\": \"identity\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_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
application/json
Response
Fields reordered
⌘I