---
title: "PUT /api/v1/projects/{project_pk}/segments/{id}/"
method: PUT
path: "/api/v1/projects/{project_pk}/segments/{id}/"
tags: ["mcp"]
---

# PUT /api/v1/projects/{project_pk}/segments/{id}/

`PUT /api/v1/projects/{project_pk}/segments/{id}/`

Updates an existing user segment's properties and rules.

## Path parameters

- `id` integer, required
- `project_pk` integer, required

## Request body

- Segment — Functionality for serializers that need to handle metadata
  - `id` integer
  - `uuid` string, uuid
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `name` string, required
  - `description` string, nullable
  - `project` integer
  - `feature` integer, nullable
  - `version_of` integer, nullable
  - `rules` SegmentRule[], required
    - `id` integer
    - `type` 'ALL' | 'ANY' | 'NONE', required — * `ALL` - all * `ANY` - any * `NONE` - none
    - `rules` NestedSegmentRule[]
      - `id` integer
      - `type` 'ALL' | 'ANY' | 'NONE', required — * `ALL` - all * `ANY` - any * `NONE` - none
      - `conditions` Condition[]
        - `id` integer
        - `operator` 'EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'CONTAINS' | 'GREATER_THAN_INCLUSIVE' | 'LESS_THAN_INCLUSIVE' | 'NOT_CONTAINS' | 'NOT_EQUAL' | 'REGEX' | 'PERCENTAGE_SPLIT' | 'MODULO' | 'IS_SET' | 'IS_NOT_SET' | 'IN', required — * `EQUAL` - Exactly Matches * `GREATER_THAN` - Greater than * `LESS_THAN` - Less than * `CONTAINS` - Contains * `GREATER_THAN_INCLUSIVE` - Greater than or equal to * `LESS_THAN_INCLUSIVE` - Less than or equal to * `NOT_CONTAINS` - Does not contain * `NOT_EQUAL` - Does not match * `REGEX` - Matches regex * `PERCENTAGE_SPLIT` - Percentage split * `MODULO` - Modulo Operation * `IS_SET` - Is set * `IS_NOT_SET` - Is not set * `IN` - In
        - `property` string, nullable
        - `value` string, nullable
        - `description` string, nullable
        - `delete` boolean
      - `delete` boolean
    - `conditions` Condition[]
      - `id` integer
      - `operator` 'EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'CONTAINS' | 'GREATER_THAN_INCLUSIVE' | 'LESS_THAN_INCLUSIVE' | 'NOT_CONTAINS' | 'NOT_EQUAL' | 'REGEX' | 'PERCENTAGE_SPLIT' | 'MODULO' | 'IS_SET' | 'IS_NOT_SET' | 'IN', required — * `EQUAL` - Exactly Matches * `GREATER_THAN` - Greater than * `LESS_THAN` - Less than * `CONTAINS` - Contains * `GREATER_THAN_INCLUSIVE` - Greater than or equal to * `LESS_THAN_INCLUSIVE` - Less than or equal to * `NOT_CONTAINS` - Does not contain * `NOT_EQUAL` - Does not match * `REGEX` - Matches regex * `PERCENTAGE_SPLIT` - Percentage split * `MODULO` - Modulo Operation * `IS_SET` - Is set * `IS_NOT_SET` - Is not set * `IN` - In
      - `property` string, nullable
      - `value` string, nullable
      - `description` string, nullable
      - `delete` boolean
    - `delete` boolean
  - `metadata` Metadata[]
    - `id` integer
    - `model_field` integer, required
    - `field_value` string, required
  - `membership_counts` SegmentMembershipCount[]
    - `environment` integer
    - `count` integer
    - `last_synced_at` string, date-time
  - `managed_by` union
    - 'cohort' — * `` - Unmanaged * `cohort` - Cohort
    - ''
  - `cohort` SegmentCohort
    - `id` integer
    - `environment` integer, required
    - `environment_api_key` string
    - `environment_name` string
    - `source_type` 'csv' | 'amplitude' | 'mixpanel' — * `csv` - CSV * `amplitude` - Amplitude * `mixpanel` - Mixpanel
    - `version` integer
    - `deletion_requested_at` string, date-time, nullable
  - `has_overrides` boolean — Whether any feature override points at this segment, counting overrides that are live now or scheduled to go live.

## Response `200`

- Segment — Functionality for serializers that need to handle metadata
  - `id` integer
  - `uuid` string, uuid
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `name` string, required
  - `description` string, nullable
  - `project` integer
  - `feature` integer, nullable
  - `version_of` integer, nullable
  - `rules` SegmentRule[], required
    - `id` integer
    - `type` 'ALL' | 'ANY' | 'NONE', required — * `ALL` - all * `ANY` - any * `NONE` - none
    - `rules` NestedSegmentRule[]
      - `id` integer
      - `type` 'ALL' | 'ANY' | 'NONE', required — * `ALL` - all * `ANY` - any * `NONE` - none
      - `conditions` Condition[]
        - `id` integer
        - `operator` 'EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'CONTAINS' | 'GREATER_THAN_INCLUSIVE' | 'LESS_THAN_INCLUSIVE' | 'NOT_CONTAINS' | 'NOT_EQUAL' | 'REGEX' | 'PERCENTAGE_SPLIT' | 'MODULO' | 'IS_SET' | 'IS_NOT_SET' | 'IN', required — * `EQUAL` - Exactly Matches * `GREATER_THAN` - Greater than * `LESS_THAN` - Less than * `CONTAINS` - Contains * `GREATER_THAN_INCLUSIVE` - Greater than or equal to * `LESS_THAN_INCLUSIVE` - Less than or equal to * `NOT_CONTAINS` - Does not contain * `NOT_EQUAL` - Does not match * `REGEX` - Matches regex * `PERCENTAGE_SPLIT` - Percentage split * `MODULO` - Modulo Operation * `IS_SET` - Is set * `IS_NOT_SET` - Is not set * `IN` - In
        - `property` string, nullable
        - `value` string, nullable
        - `description` string, nullable
        - `delete` boolean
      - `delete` boolean
    - `conditions` Condition[]
      - `id` integer
      - `operator` 'EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'CONTAINS' | 'GREATER_THAN_INCLUSIVE' | 'LESS_THAN_INCLUSIVE' | 'NOT_CONTAINS' | 'NOT_EQUAL' | 'REGEX' | 'PERCENTAGE_SPLIT' | 'MODULO' | 'IS_SET' | 'IS_NOT_SET' | 'IN', required — * `EQUAL` - Exactly Matches * `GREATER_THAN` - Greater than * `LESS_THAN` - Less than * `CONTAINS` - Contains * `GREATER_THAN_INCLUSIVE` - Greater than or equal to * `LESS_THAN_INCLUSIVE` - Less than or equal to * `NOT_CONTAINS` - Does not contain * `NOT_EQUAL` - Does not match * `REGEX` - Matches regex * `PERCENTAGE_SPLIT` - Percentage split * `MODULO` - Modulo Operation * `IS_SET` - Is set * `IS_NOT_SET` - Is not set * `IN` - In
      - `property` string, nullable
      - `value` string, nullable
      - `description` string, nullable
      - `delete` boolean
    - `delete` boolean
  - `metadata` Metadata[]
    - `id` integer
    - `model_field` integer, required
    - `field_value` string, required
  - `membership_counts` SegmentMembershipCount[]
    - `environment` integer
    - `count` integer
    - `last_synced_at` string, date-time
  - `managed_by` union
    - 'cohort' — * `` - Unmanaged * `cohort` - Cohort
    - ''
  - `cohort` SegmentCohort
    - `id` integer
    - `environment` integer, required
    - `environment_api_key` string
    - `environment_name` string
    - `source_type` 'csv' | 'amplitude' | 'mixpanel' — * `csv` - CSV * `amplitude` - Amplitude * `mixpanel` - Mixpanel
    - `version` integer
    - `deletion_requested_at` string, date-time, nullable
  - `has_overrides` boolean — Whether any feature override points at this segment, counting overrides that are live now or scheduled to go live.

## Changes

- **2026-08-26** `5a8154d05269` — 1 info
  - added the optional property `has_overrides` to the response with the `200` status
- **2026-08-26** `87e7d6868520` — 1 warning, 3 info
  - added the new `mixpanel` enum value to the `cohort/oneOf[#/components/schemas/_SegmentCohort]/source_type` response property for the response status `200`
  - added the new `mixpanel` enum value to the request property `cohort/oneOf[#/components/schemas/_SegmentCohort]/source_type` (media type: application/json)
  - added the new `mixpanel` enum value to the request property `cohort/oneOf[#/components/schemas/_SegmentCohort]/source_type` (media type: application/x-www-form-urlencoded)
  - added the new `mixpanel` enum value to the request property `cohort/oneOf[#/components/schemas/_SegmentCohort]/source_type` (media type: multipart/form-data)
- **2026-08-25** `dd463c39d609` — 1 info
  - added the optional property `cohort` to the response with the `200` status
- **2026-08-12** `163812663fc2` — 1 breaking, 4 info
  - the response property `project` became optional for the status `200`
  - the request required property `project` became read-only (media type: application/json)
  - the request required property `project` became read-only (media type: application/x-www-form-urlencoded)
  - the request required property `project` became read-only (media type: multipart/form-data)
  - …1 more
- …earlier changes not shown

[Full history](https://skmtc.dev/flagsmith/apis/flagsmith-api/changes/api/v1/projects/:project_pk/segments/:id/put.md)

---

[API](https://skmtc.dev/flagsmith/apis/flagsmith-api.md) · [All operations](https://skmtc.dev/flagsmith/apis/flagsmith-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flagsmith/flagsmith-api/revisions/5a8154d05269/schema)
