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

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

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

## Request

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

## Path parameters

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

## Request body

- UpdateFlagRequest
  - `key` string
  - `name` string, required
  - `description` string
  - `enabled` boolean
  - `namespaceKey` string
  - `defaultVariantId` string
  - `metadata` object

## Response `200`

OK

- Flag
  - `key` string
  - `name` string
  - `description` string
  - `enabled` boolean
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `variants` Variant[]
    - `id` string
    - `flagKey` string
    - `key` string
    - `name` string
    - `description` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `attachment` string
    - `namespaceKey` string
  - `namespaceKey` string
  - `type` 'VARIANT_FLAG_TYPE' | 'BOOLEAN_FLAG_TYPE', enum
  - `defaultVariant` Variant
    - `id` string
    - `flagKey` string
    - `key` string
    - `name` string
    - `description` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `attachment` string
    - `namespaceKey` string
  - `metadata` object

## Changes

- **2024-08-08** `594afc3dbe2e`: 1 breaking, 2 warning
  - the `type` response's property type changed from `integer` to `string` for status `200`
  - added the new `BOOLEAN_FLAG_TYPE` enum value to the `type` response property for the response status `200`
  - added the new `VARIANT_FLAG_TYPE` enum value to the `type` response property for the response status `200`
- **2024-08-07** `291b2f802c58`: 1 breaking, 2 info
  - the `type` response's property type changed from `string` to `integer` for status `200`
  - removed the `BOOLEAN_FLAG_TYPE` enum value from the `type` response property for the response status `200`
  - removed the `VARIANT_FLAG_TYPE` enum value from the `type` response property for the response status `200`

[Operation history](https://skmtc.dev/flipt-io/apis/flipt-api/changes/api/v1/namespaces/:namespaceKey/flags/: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)
