v1
latestOpenAPI 3.0.32026-07-26120117318.1 KBSegments
Create a segment
Creates a new segment. Returns 201 with the created segment and Location header.
post/segments
Headers
Idempotency-Keystring
Idempotency key for safe retries.
Request body
Example request
{
"name": "Premium Users",
"conditions": [
{
"metric": "environment",
"comparator": "eq",
"value": "prod",
"negate": false
}
]
}Response
Segment created
Example response
{
"object": "segment",
"id": "premium-users",
"url": "/v4/segments/premium-users",
"name": "Premium Users",
"conditions": [
{
"metric": "environment",
"comparator": "eq",
"value": "prod"
}
],
"created_at": "2025-09-15T12:30:00Z",
"updated_at": "2025-11-03T10:26:40Z"
}