Skip to content

Update Conditional

PATCH
/api/v1/workspaces/{workspace_id}/conditionals/{id}

Updates a conditional.

workspace_id
required
integer

Workspace ID

id
required
integer

Conditional ID

object
label
string
Example
Over Age 30s
can_be_used_in_subject_and_preheader

Whether this conditional is permitted to be used in a subject or preheader.

boolean
branches
Array<object>
object
key
required
string
Example
gold_membership
label
required
string
Example
Gold Membership
default_syntax
object
closing
required

The closing syntax tag for the conditional block.

string
Example
{% endif %}
branch_values

Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.

object
key
additional properties
string
Example
{
"gold_membership": "{% if membership == 'gold' %}",
"silver_membership": "{% elsif membership == 'silver' %}"
}
dynamic_content_profile_syntaxes
object
key
additional properties

A per-DynamicContentProfile syntax entry on a Conditional. Either a manually-authored {closing, branch_values} pair or a picker-authored {uses_ui_picker, ui_picker_state} pair — the two modes are mutually exclusive.

object
closing

Manual mode only. The closing syntax tag for the conditional block.

string
Example
{% endif %}
branch_values

Manual mode only. Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.

object
key
additional properties
string
Example
{
"gold_membership": "{% if membership == 'gold' %}",
"silver_membership": "{% elsif membership == 'silver' %}"
}
uses_ui_picker

When true, the syntax for this dynamic content profile was authored via the UI picker for the profile’s template engine preset. When false or absent, it was defined manually.

boolean
ui_picker_state

Authored picker state when uses_ui_picker is true. Null or absent otherwise. The template engine preset renders this into {closing, branch_values} on read.

object
include_else_branch
required

When true, the final branch of the parent Conditional is rendered as an else branch and its key is omitted from branches below.

boolean
branches
required

Picker state keyed by branch key. Includes one entry per non-else branch; when include_else_branch is true the final branch key is omitted.

object
key
additional properties

Picker-authored state for a single non-else branch of a conditional.

object
joiner
required

How multiple conditions combine (e.g. “and”, “or”). Always present for a stable shape; only semantically meaningful when conditions has more than one entry. Must be one of the joiners allowed by the preset — see template_engine_preset_schema.joiners.

string
Example
and
conditions
required

Conditions that must all (or any, depending on joiner) hold for this branch to match. At least one entry required.

Array<object>
>= 1 items

A single condition within a picker branch. Validated server-side against the profile’s template engine preset capabilities.

object
field
required

The reference the template engine reads when evaluating this condition (e.g. “profile.tier”).

string
Example
profile.tier
type
required

Declared value type. Drives the allowed operators and the shape of value.

string
Allowed values: string number boolean
Example
string
operator
required

One of the operators the preset allows for the declared type. See template_engine_preset_schema.operators_by_type[type] on the associated DynamicContentProfile.

string
Example
equals
value

The value being compared against. Always a string on the wire; the preset renderer decides how to format it based on type (quoted for “string”, raw for “number”/“boolean”). Required when the operator’s definition has requires_value=true; null (or absent) when requires_value=false.

string
nullable
Example
gold
Example
{
"gold": {
"joiner": "and",
"conditions": [
{
"field": "profile.tier",
"type": "string",
"operator": "equals",
"value": "gold"
}
]
}
}

Successful

object
id
required
integer
Example
12345
label
required
string
Example
Over age 30s
default_syntax
required
object
closing
required

The closing syntax tag for the conditional block.

string
Example
{% endif %}
branch_values

Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.

object
key
additional properties
string
Example
{
"gold_membership": "{% if membership == 'gold' %}",
"silver_membership": "{% elsif membership == 'silver' %}"
}
branches
required
Array<object>
object
key
required
string
Example
gold_membership
label
required
string
Example
Gold Membership
can_be_used_in_subject_and_preheader
required
boolean
created_at
required
string format: date-time
Example
2023-08-23T10:30:00.000Z
updated_at
required
string format: date-time
Example
2023-08-23T10:30:00.000Z
organization_id
required
integer
Example
12345
dynamic_content_profile_syntaxes
required
object
key
additional properties

A per-DynamicContentProfile syntax entry on a Conditional. Either a manually-authored {closing, branch_values} pair or a picker-authored {uses_ui_picker, ui_picker_state} pair — the two modes are mutually exclusive.

object
closing

Manual mode only. The closing syntax tag for the conditional block.

string
Example
{% endif %}
branch_values

Manual mode only. Key-value pairs where the key is the branch key and the value is the opening syntax for that branch.

object
key
additional properties
string
Example
{
"gold_membership": "{% if membership == 'gold' %}",
"silver_membership": "{% elsif membership == 'silver' %}"
}
uses_ui_picker

When true, the syntax for this dynamic content profile was authored via the UI picker for the profile’s template engine preset. When false or absent, it was defined manually.

boolean
ui_picker_state

Authored picker state when uses_ui_picker is true. Null or absent otherwise. The template engine preset renders this into {closing, branch_values} on read.

object
include_else_branch
required

When true, the final branch of the parent Conditional is rendered as an else branch and its key is omitted from branches below.

boolean
branches
required

Picker state keyed by branch key. Includes one entry per non-else branch; when include_else_branch is true the final branch key is omitted.

object
key
additional properties

Picker-authored state for a single non-else branch of a conditional.

object
joiner
required

How multiple conditions combine (e.g. “and”, “or”). Always present for a stable shape; only semantically meaningful when conditions has more than one entry. Must be one of the joiners allowed by the preset — see template_engine_preset_schema.joiners.

string
Example
and
conditions
required

Conditions that must all (or any, depending on joiner) hold for this branch to match. At least one entry required.

Array<object>
>= 1 items

A single condition within a picker branch. Validated server-side against the profile’s template engine preset capabilities.

object
field
required

The reference the template engine reads when evaluating this condition (e.g. “profile.tier”).

string
Example
profile.tier
type
required

Declared value type. Drives the allowed operators and the shape of value.

string
Allowed values: string number boolean
Example
string
operator
required

One of the operators the preset allows for the declared type. See template_engine_preset_schema.operators_by_type[type] on the associated DynamicContentProfile.

string
Example
equals
value

The value being compared against. Always a string on the wire; the preset renderer decides how to format it based on type (quoted for “string”, raw for “number”/“boolean”). Required when the operator’s definition has requires_value=true; null (or absent) when requires_value=false.

string
nullable
Example
gold
Example
{
"gold": {
"joiner": "and",
"conditions": [
{
"field": "profile.tier",
"type": "string",
"operator": "equals",
"value": "gold"
}
]
}
}

Unauthorized

object
message
required
string
Example
Record not found

Forbidden

object
message
required
string
Example
Record not found

Not Found

object
message
required
string
Example
Record not found

Unprocessable Entity

object
message
required
string
Example
Failed to save
errors
required
object
key
additional properties
Array<string>
Example
{
"errors": {
"username": [
"Username is required.",
"Username must be unique."
],
"email": [
"Invalid email format."
]
}
}