v1

latestOpenAPI 3.0.32026-07-26120117318.1 KB
Segments

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

namestring required

Segment name (max 256 characters).

Example request

{
  "name": "Premium Users",
  "conditions": [
    {
      "metric": "environment",
      "comparator": "eq",
      "value": "prod",
      "negate": false
    }
  ]
}

Response

Segment created

objectstring required
idstring required

Segment identifier.

urlstring required

Canonical API path.

namestring required

Display name.

is_systemboolean required

Whether this is a predefined system segment (read-only).

created_atstring date-time required

ISO 8601 creation timestamp.

updated_atstring date-time required

ISO 8601 last update timestamp.

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"
}