---
title: "Create Segment"
method: POST
path: "/v1/products/{productId}/segments"
tags: ["Segments"]
---

# Create Segment

`POST /v1/products/{productId}/segments`

## Request

- Base URL: `https://api.configcat.com`
- URL: `https://api.configcat.com/v1/products/{productId}/segments`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/configcat/apis/configcat-public-management-api/docs/v1/products/:productId/segments/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint creates a new Segment in a specified Product 
identified by the `productId` parameter, which can be obtained from the [List Products](#operation/get-products) endpoint.

## Path parameters

- `productId` string, uuid, required

## Request body

- CreateSegmentModel
  - `name` string, required: Name of the Segment.
  - `description` string, nullable: Description of the Segment.
  - `comparisonAttribute` string, required: The user's attribute the evaluation process must take into account.
  - `comparator` 'isOneOf' | 'isNotOneOf' | 'contains' | 'doesNotContain' | 'semVerIsOneOf' | 'semVerIsNotOneOf' | 'semVerLess' | 'semVerLessOrEquals' | 'semVerGreater' | 'semVerGreaterOrEquals' | 'numberEquals' | 'numberDoesNotEqual' | 'numberLess' | 'numberLessOrEquals' | 'numberGreater' | 'numberGreaterOrEquals' | 'sensitiveIsOneOf' | 'sensitiveIsNotOneOf', required: The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value.
  - `comparisonValue` string, required: The value to compare with the given user attribute's value.

## Response `201`

When the creation was successful.

- SegmentModel
  - `product` ProductModel, required: Details of the Product.
    - `organization` OrganizationModel, required: Details of the Organization.
      - `organizationId` string, uuid, required: Identifier of the Organization.
      - `name` string, required: Name of the Organization.
    - `productId` string, uuid, required: Identifier of the Product.
    - `name` string, required: Name of the Product.
    - `description` string, nullable, required: Description of the Product.
    - `order` integer, required: The order of the Product represented on the ConfigCat Dashboard. Determined from an ascending sequence of integers.
    - `reasonRequired` boolean, required: Determines whether a mandatory reason must be given every time when the Feature Flags or Settings within a Product are saved.
    - `approveRequired` boolean, required: Determines whether changes must be approved before they are applied within a Product.
  - `segmentId` string, uuid, required: Identifier of the Segment.
  - `name` string, required: Name of the Segment.
  - `description` string, nullable, required: Description of the Segment.
  - `creatorEmail` string, nullable, required: The email of the user who created the Segment.
  - `creatorFullName` string, nullable, required: The name of the user who created the Segment.
  - `createdAt` string, date-time, required: The date and time when the Segment was created.
  - `lastUpdaterEmail` string, nullable, required: The email of the user who last updated the Segment.
  - `lastUpdaterFullName` string, nullable, required: The name of the user who last updated the Segment.
  - `updatedAt` string, date-time, required: The date and time when the Segment was last updated.
  - `comparisonAttribute` string, required: The user's attribute the evaluation process must take into account.
  - `comparator` 'isOneOf' | 'isNotOneOf' | 'contains' | 'doesNotContain' | 'semVerIsOneOf' | 'semVerIsNotOneOf' | 'semVerLess' | 'semVerLessOrEquals' | 'semVerGreater' | 'semVerGreaterOrEquals' | 'numberEquals' | 'numberDoesNotEqual' | 'numberLess' | 'numberLessOrEquals' | 'numberGreater' | 'numberGreaterOrEquals' | 'sensitiveIsOneOf' | 'sensitiveIsNotOneOf', required: The comparison operator the evaluation process must use when it compares the given user attribute's value with the comparison value.
  - `comparisonValue` string, required: The value to compare with the given user attribute's value.

## Other responses

- `400`: Bad request.
- `404`: Not found.
- `429`: Too many requests. In case of the request rate exceeds the rate limits.

## Changes

- **2026-06-08** `fc2e575e2bd3`: 1 info
  - added the required property `product/approveRequired` to the response with the `201` status
- **2025-10-09** `8b8a102e5ed1`: 6 info
  - the response property `creatorEmail` became required for the status `201`
  - the response property `creatorFullName` became required for the status `201`
  - the response property `description` became required for the status `201`
  - the response property `lastUpdaterEmail` became required for the status `201`
  - …2 more
- **2025-05-16** `2949501eef38`: 15 info
  - the response property `comparator` became required for the status `201`
  - the response property `comparisonAttribute` became required for the status `201`
  - the response property `comparisonValue` became required for the status `201`
  - the response property `createdAt` became required for the status `201`
  - …11 more
- **2024-05-18** `f14408c16a8c`: 10 breaking, 1 info
  - the `comparisonAttribute` request property's minLength was increased from `0` to `1` (media type: application/json)
  - the `comparisonAttribute` request property's minLength was increased from `0` to `1` (media type: text/json)
  - the `comparisonAttribute` request property's minLength was increased from `0` to `1` (media type: application/*+json)
  - the `comparisonValue` request property's minLength was increased from `0` to `1` (media type: application/json)
  - …7 more

[Operation history](https://skmtc.dev/configcat/apis/configcat-public-management-api/changes/v1/products/:productId/segments/post.md)

---

[API](https://skmtc.dev/configcat/apis/configcat-public-management-api.md) - [All operations](https://skmtc.dev/configcat/apis/configcat-public-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/configcat/apis/configcat-public-management-api/revisions/0f143561d265?raw)
