DynamicSegments

Create a dynamic segment on an asset

Create a dynamic segment scoped to a single asset. Requires the local_dynamic_segments permission. A user who cannot create a local segment in the builder cannot create one through this endpoint.

Identifying merge tags

A condition names the merge tag it tests by id, not by expression. Obtain ids from GET /merge-tags. Knak derives the platform expression and returns it as the read-only category field.

Operators

The operators available to a condition depend on its merge_tag_type. Four of them take no value at all, and sending one anyway is rejected.

merge_tag_typeOperatorsvalue
stringequals, not-equals, contains, not-contains, in, startsWith, not-startsWith, endsWith, not-endsWith, length-equalsRequired, max 200 characters
stringhasContent, not-hasContentOmit
numberequals, not-equals, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualToRequired
dateequals, not-equals, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualToRequired
relative_dateequals, not-equals, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualToRequired
booleanisTrue, isFalseOmit

Limits

  • 20 platform segments per request
  • Condition sets nest 4 deep
  • 20 conditions and 5 nested condition sets per condition set
  • 200 characters per string value

Platform support

Only marketing_cloud is supported for segment conditional logic. Sending any other platform returns 422.

Atomicity

Every platform segment is validated before any is written, so a request that fails on its third entry leaves nothing behind.

post/assets/{asset_id}/dynamic-segments

Request

Path parameters

asset_idstring required

ID of asset. Must be an email; dynamic segments are only available on emails.

Request body

namestring required

Must be unique among the segments already on this asset.

Example request

{
  "name": "Canada - Enterprise",
  "platform_dynamic_segments": [
    {
      "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

Created

Changes

No recorded changes to this operation across all 1 revision of this API.