v1
latestOpenAPI 3.0.12026-07-2471135326.0 KBSegments
Create Segment
This endpoint allows you to create a new segment via JSON body or from a CSV file. Query parameters are supported. If csv file is used, then the segment will be created matching content from a source column with a target column (segment will be typed as static). If json body is used, then the conditions for the segment can be passed through the body or as query params.
post/v3/lists/{listId}/segments
Path parameters
listIdinteger required
Provide the unique ID of the list
Query parameters
namestring
The name of the segment (If using a csv file)
sourceColumnstring
Column to segment from CSV file (If using a csv file)
targetColumnstring
Column to apply segment from main list (If using a csv file)
Request body
Example request
{
"name": "people who likes movies",
"queryRule": "movies[eq]=horror&age[gt]=21"
}Response
Accepted the request to create the segment.
Example response
{
"meta": {
"timestamp": 1597166699457,
"transactionId": "70169d77-c165-4795-9932-35b8a3af96fb",
"explain": "a descriptive text"
},
"data": {
"id": "507f1f77bcf86cd799439011",
"name": "people who likes movies",
"userName": "homer",
"listId": 203,
"queryRule": "movies[eq]=horror&age[gt]=21",
"total": 7
}
}