Skip to content

Update Dynamic Content Profile

PATCH
/api/v1/workspaces/{workspace_id}/dynamic_content_profiles/{id}
curl --request PATCH \
--url https://example.com/%7B%7Bapp_url%7D/api/v1/workspaces/1/dynamic_content_profiles/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Mailchimp Profile", "locale_conditional": { "if_syntax": "{% if ${language} == \"{{locale}}\" %}", "else_if_syntax": "{% elsif ${language} == \"{{locale}}\" %}", "end_syntax": "{% endif %}", "locale_values": { "fr-FR": "fr", "en-GB": "UKEN" } } }'

Updates a DynamicContentProfile.

  • OAuth2
    dynamic_content_profiles:write
workspace_id
required
integer

Workspace ID

id
required
string

Conditional ID

Media typeapplication/json
object
name
string
Example
Mailchimp Profile
locale_conditional
One of:

The ESP syntax used to wrap each locale’s content in a conditional when locales are combined into a single email. In the if and else if syntax, {{locale}} is replaced with the locale’s code in the ESP: its mapping in locale_values, or the locale code itself if it has no mapping.

object
if_syntax
required

Opening syntax for the first locale. Must include {{locale}}.

string
Example
{% if ${language} == "{{locale}}" %}
else_if_syntax
required

Opening syntax for every locale after the first. Must include {{locale}}.

string
Example
{% elsif ${language} == "{{locale}}" %}
end_syntax
required

The closing syntax for the conditional.

string
Example
{% endif %}
locale_values
required

Maps a locale code (e.g. fr-FR) to the code the ESP stores for that locale (e.g. fr), for ESPs that use their own locale format. Locales without a mapping use their locale code unchanged.

object
key
additional properties
string
Example
{
"fr-FR": "fr",
"en-GB": "UKEN"
}

Successful

Media typeapplication/json
object
id
required
string
name
required
string
created_at
required
string format: date-time
updated_at
required
string format: date-time
organization_id
required
integer
locale_conditional
required
One of:

The ESP syntax used to wrap each locale’s content in a conditional when locales are combined into a single email. In the if and else if syntax, {{locale}} is replaced with the locale’s code in the ESP: its mapping in locale_values, or the locale code itself if it has no mapping.

object
if_syntax
required

Opening syntax for the first locale. Must include {{locale}}.

string
else_if_syntax
required

Opening syntax for every locale after the first. Must include {{locale}}.

string
end_syntax
required

The closing syntax for the conditional.

string
locale_values
required

Maps a locale code (e.g. fr-FR) to the code the ESP stores for that locale (e.g. fr), for ESPs that use their own locale format. Locales without a mapping use their locale code unchanged.

object
key
additional properties
string
Example
{
"id": "uuid TODO",
"name": "Mailchimp Profile",
"created_at": "2023-08-23T10:30:00.000Z",
"updated_at": "2023-08-23T10:30:00.000Z",
"organization_id": 12345,
"locale_conditional": {
"if_syntax": "{% if ${language} == \"{{locale}}\" %}",
"else_if_syntax": "{% elsif ${language} == \"{{locale}}\" %}",
"end_syntax": "{% endif %}",
"locale_values": {
"fr-FR": "fr",
"en-GB": "UKEN"
}
}
}

Unauthorized

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Forbidden

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Not Found

Media typeapplication/json
object
message
required
string
code
string
Example
{
"message": "Record not found",
"code": "share_link_expired"
}

Unprocessable Entity

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