curl --request POST \
--url https://{cluster}.voucherify.io/v1/segments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Customers in a new Segment",
"type": "static",
"customers": [
"cust_iajsExT2QB4sGWzABY85WRqV",
"cust_sehkNIi8Uq2qQuRqSr7xn4Zi"
]
}
'{
"id": "seg_vC8iOSCqUG02EsPzsHynLv8i",
"name": "Customers in a new Segment",
"created_at": "2022-09-13T08:57:15.801Z",
"type": "static",
"filter": null,
"initial_sync_status": "DONE",
"object": "segment"
}Create Segment
Create a customer segment.
Limit on static segments
There is a cap on the number of customers that you can assign to a static segment: 20,000. If you would like to create a bigger segment, then you can use the unlimited auto-update or passive segment instead and use some customer metadata to build this segment.
Limit on Active and Passive segments
You can create a maximum of 100 passive and active segments.
POST
/
v1
/
segments
curl --request POST \
--url https://{cluster}.voucherify.io/v1/segments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Customers in a new Segment",
"type": "static",
"customers": [
"cust_iajsExT2QB4sGWzABY85WRqV",
"cust_sehkNIi8Uq2qQuRqSr7xn4Zi"
]
}
'{
"id": "seg_vC8iOSCqUG02EsPzsHynLv8i",
"name": "Customers in a new Segment",
"created_at": "2022-09-13T08:57:15.801Z",
"type": "static",
"filter": null,
"initial_sync_status": "DONE",
"object": "segment"
}Authorizations
X-App-Id & X-App-TokenX-Voucherify-OAuth
Scopes
Body
application/json
Specify the boundary conditions for the customer segment.
- Static Customer Segment
- Active or Passive Customer Segment
Request body schema for creating a static customer segment in POST v1/segments.
Response
200 - application/json
Returns a customer segment object.
Response body schema for POST v1/segments.
Defines whether the segment is:
- Active (
auto-update): customers enter and leave the segment based on the defined filters and thecustomer.segment.enteredandcustomer.segment.leftevents are triggered, - Passive (
passive): customers enter and leave the segment based on the defined filters, but thecustomer.segment.enteredandcustomer.segment.leftevents are not triggered, - Static (
static): manually selected customers.
Available options:
auto-update, passive, static 
