Edit a dynamic segment
Rename a dynamic segment, replace its platform segments, or both. Requires the local_dynamic_segments permission. Global segments cannot be edited through an asset route and return 422.
Both properties are optional
Anything you leave out is left alone. A body of {"name": "New name"} renames the segment and does not touch its platform segments. An empty body changes nothing.
Sending platform_dynamic_segments replaces the whole collection
This is destructive. When you send the property, the collection you send becomes the collection that exists:
- An entry with an id updates that platform segment in place
- An entry without an id creates a new platform segment
- An existing platform segment you leave out is deleted
- An empty array deletes all of them
Omitting the property entirely is the only way to leave the collection untouched. A client that reads a segment, drops a property it does not recognize, and writes the result back will delete platform segments. If you only mean to rename, send name on its own.
An id that belongs to a different segment is rejected with 422 and nothing is written.
The segment id is stable
Content variants address a segment by its id, so replacing every platform segment does not break variants already pointing at it.
Atomicity
Validation of every entry completes before any write, and the delete, update, and create steps run in one transaction. A request that fails partway leaves the segment exactly as it was.
Operators, value rules, and limits are identical to the create operation.
Request
- Base URLhttps://enterprise.knak.io/api/published/v1
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
ID of asset. Must be an email; dynamic segments are only available on emails.
ID of the dynamic segment
Request body
Example request
{
"name": "Canada - Enterprise and Mid Market",
"platform_dynamic_segments": [
{
"id": "68b41c9f31f04",
"platform": "marketing_cloud",
"integration_id": "5f2c7a1b9e844",
"conditional_logic": {
"type": "condition_set",
"conjunction": "and",
"children": [
{
"type": "condition",
"merge_tag_id": "68b41c9f31f04",
"merge_tag_type": "string",
"operator": "equals"
}
]
}
}
]
}Response
OK. Returns the updated segment in the same shape as create.
Changes
No recorded changes to this operation across all 1 revision of this API.