Create new segment using API
Learn more about the Segmentation Api to create a new segment.
This POST API will enable you to create a new segment.
Request
POST /{tenantId}/segments
Parameter | Required | Description | |
---|---|---|---|
Headers | Authorization
| Yes | Information about authentication access token in the format "Bearer <accessToken> ". For more information, see Authentication API. |
Request body
[
{
"label": "Platinum Members",
"sharing":"private",
"rule": "equals(entity.attributes.Gender, 'M') and range(entity.attributes.Age, 30, 40) and equals(entity.attributes.Address.City, 'NY') and gte(count(equals(interaction.type, 'configuration/interactionTypes/Meeting')), 2)",
"schedule": {
"startTime": "2000-10-31T01:30:00.000-05:00",
"repeat":"RRULE:FREQ=WEEKLY;BYDAY=FR"
},
"description": "<description provided by the user>",
}
]
Response
[
{
"index": 0,
"object": {
"id": "S1",
"label": "Platinum Members",
"owner": "Cris.Davis@mail.com",
"sharing":"private",
"type": "batch",
"status": "submitted",
"rule": "equals(entity.attributes.Gender, 'M') and range(entity.attributes.Age, 30, 40) and equals(entity.attributes.Address.City, 'NY') and gte(count(equals(interaction.type, 'configuration/interactionTypes/Meeting')), 2)",
"schedule": {
"startTime": "2000-10-31T01:30:00.000-05:00",
"repeat":"RRULE:FREQ=WEEKLY;BYDAY=FR"
},
"description": "<description provided by the user>",
}
}
]