Lists all templates available for segment creation. Returned templated definitions include the required user
input which will then be interpolated into the templated attributes and segment definition in order to
create the needed resources. See the applyTemplate endpoint for more details on how to.
[- {
- "id": "new_to_brand",
- "name": "New to Brand",
- "userInput": {
- "brand": {
- "type": "string"
}, - "days": {
- "type": "int"
}
}, - "attributes": [
- {
- "key": "new_to_brand_attribute",
- "name": "New to {{brand}}",
- "matchRule": "meta[\"type\"] == \"orderPlace\" && exists(x:views[\"products\"], x[\"brand\"] == \"{{brand}}\")",
- "attrPaths": [
- "$.meta.timestampMillis"
], - "aggregation": {
- "type": "most-recent"
}, - "periodDays": "{{days}}"
}
], - "segment": {
- "name": "New to {{brand}}",
- "description": "Customers who are entering the brand for the first time or re-engaging after a long absence",
- "category": "New buyer",
- "rule": "not({{keys.new_to_brand_attribute}} after {{days}} days ago)"
}
}
]Creates a segment and the respective attributes that feed it by applying user input to the template with the ID specified in the endpoint's path. The network ID is also required in order for the newly created segment to be associated with the User DB destination for that network.
The response contains the IDs of the created segment and attributes, along with the template that was used.
| id required | string The template ID to use for segment creation. |
| networkId required | integer <int32> The network ID to associate the segment with in the respective KevelNativeSegments destination. |
| advertiserId required | integer <int64> The ID of the advertiser creating this segment. |
required | object (Map_Json) Map of user inputs to interpolate into the template. These will be validated in accordance with the expected type attributed to the input in the template's definition. |
{- "networkId": 10000,
- "advertiserId": 2712478,
- "userInputs": {
- "brand": "Kevel",
- "days": 5
}
}{- "segmentId": 0,
- "template": {
- "id": "new_to_brand",
- "name": "New to Brand",
- "userInput": {
- "brand": {
- "type": "string"
}, - "days": {
- "type": "int"
}
}, - "attributes": [
- {
- "key": "new_to_brand_attribute",
- "name": "New to {{brand}}",
- "matchRule": "meta[\"type\"] == \"orderPlace\" && exists(x:views[\"products\"], x[\"brand\"] == \"{{brand}}\")",
- "attrPaths": [
- "$.meta.timestampMillis"
], - "aggregation": {
- "type": "most-recent"
}, - "periodDays": "{{days}}"
}
], - "segment": {
- "name": "New to {{brand}}",
- "description": "Customers who are entering the brand for the first time or re-engaging after a long absence",
- "category": "New buyer",
- "rule": "not({{keys.new_to_brand_attribute}} after {{days}} days ago)"
}
}
}