---
title: "PUT /api/v1/namespaces/{namespaceKey}/segments/{key}"
method: PUT
path: "/api/v1/namespaces/{namespaceKey}/segments/{key}"
tags: ["Flipt", "SegmentsService"]
---

# PUT /api/v1/namespaces/{namespaceKey}/segments/{key}

`PUT /api/v1/namespaces/{namespaceKey}/segments/{key}`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/namespaces/{namespaceKey}/segments/{key}`
- Auth: HTTP bearer

## Path parameters

- `namespaceKey` string, required
- `key` string, required

## Request body

- UpdateSegmentRequest
  - `key` string
  - `name` string, required
  - `description` string
  - `matchType` 'ALL_MATCH_TYPE' | 'ANY_MATCH_TYPE', enum, required
  - `namespaceKey` string

## Response `200`

OK

- Segment
  - `key` string
  - `name` string
  - `description` string
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `constraints` Constraint[]
    - `id` string
    - `segmentKey` string
    - `type` 'UNKNOWN_COMPARISON_TYPE' | 'STRING_COMPARISON_TYPE' | 'NUMBER_COMPARISON_TYPE' | 'BOOLEAN_COMPARISON_TYPE' | 'DATETIME_COMPARISON_TYPE' | 'ENTITY_ID_COMPARISON_TYPE', enum
    - `property` string
    - `operator` string
    - `value` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `namespaceKey` string
    - `description` string
  - `matchType` 'ALL_MATCH_TYPE' | 'ANY_MATCH_TYPE', enum
  - `namespaceKey` string

## Changes

- **2024-08-08** `594afc3dbe2e`: 4 breaking, 8 warning, 2 info
  - request property `matchType` was restricted to a list of enum values
  - the `matchType` request property type changed from `integer` to `string`
  - the `constraints/items/type` response's property type changed from `integer` to `string` for status `200`
  - the `matchType` response's property type changed from `integer` to `string` for status `200`
  - …10 more
- **2024-08-07** `291b2f802c58`: 5 breaking, 8 info
  - removed the enum value `ALL_MATCH_TYPE` of the request property `matchType`
  - removed the enum value `ANY_MATCH_TYPE` of the request property `matchType`
  - the `matchType` request property type changed from `string` to `integer`
  - the `constraints/items/type` response's property type changed from `string` to `integer` for status `200`
  - …9 more

[Operation history](https://skmtc.dev/flipt-io/apis/flipt-api/changes/api/v1/namespaces/:namespaceKey/segments/:key/put.md)

---

[API](https://skmtc.dev/flipt-io/apis/flipt-api.md) - [All operations](https://skmtc.dev/flipt-io/apis/flipt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flipt-io/apis/flipt-api/revisions/6fe4caf26f13?raw)
