Skip to content

Create Conditionals

POST
/api/v1/workspaces/{workspace_id}/conditionals

Creates a new conditional.

workspace_id
required
integer

Workspace ID

object
label
required
string
Example
Over age 30
can_be_used_in_subject_and_preheader

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

boolean
branches
required
Array<object>
object
key
required
string
Example
gold_membership
label
required
string
Example
Gold Membership
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' %}"
}
dynamic_content_profile_values

A map of DynamicContentProfile IDs to platform-specific syntax values. Each value overrides the default syntax for that profile’s platform.

object
key
additional properties
string
Example
{
"a1b2c3d4-5678-90ab-cdef-1234567890ab": "*|FNAME|*"
}

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
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' %}"
}

Unauthorized

object
message
required
string
Example
Record not found

Forbidden

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."
]
}
}