Segments
Create a manual segment
Changed onCreate a manual segment with a name and a description. This request creates an empty segment. You can't create a data-driven or snapshot segment with this endpoint.
post/v1/segments
Request
- Base URLhttps://api.customer.io
- URLhttps://api.customer.io/v1/segments
- AuthHTTP bearer
Request body
Example request
{
"segment": {
"name": "Manual Segment 1",
"description": "My first manual segment"
}
}Response
Returns the segment ID and other information.
Example response
{
"segment": {
"id": 7,
"deduplicate_id": "15:1492548073",
"name": "Manual Segment 1",
"description": "My first manual segment",
"state": "finished",
"type": "manual",
"conditions": {
"and": [
{
"event": {
"filters": {
"and": [
{
"field": "to",
"inverse": false,
"operator": "eq",
"value": "premium"
},
{
"field": "from",
"inverse": true,
"operator": "eq",
"value": "premium"
}
]
},
"id": 12,
"name": "plan",
"type": "attribute_change"
},
"inverse": false,
"times": 1,
"within": 0
},
{
"segment": {
"id": 7,
"inverse": false
}
}
]
},
"created_at": 1552341937,
"updated_at": 1552341937
}
}Changes
- warning
added the new
snapshotenum value to the/response property for the response status
- warning
- breaking
the
/response's property type changed fromintegernulltonumbernullfor status - info
added the optional property
/to the response with the status - info
removed the
build_queuedenum value from the/response property for the response status - info
removed the
eventsenum value from the/response property for the response status - info
removed the
events_queuedenum value from the/response property for the response status
- breaking