> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flipt.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Flag

<RequestExample>
  ```bash cURL theme={null}
  curl --request PUT \
    --url https://try.flipt.io/api/v1/namespaces/default/flags/{key} \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --data '{
    "name": "<name>",
    "description": "<description>",
    "enabled": false,
  }'
  ```
</RequestExample>


## OpenAPI

````yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{key}
openapi: 3.0.3
info:
  title: api
  version: 1.47.0
servers:
  - url: http://localhost:8080
security:
  - bearerAuth: []
tags:
  - name: AuthenticationMethodKubernetesService
  - name: AuthenticationMethodOIDCService
  - name: AuthenticationMethodTokenService
  - name: AuthenticationService
  - name: EvaluationService
  - name: Flipt
  - name: OFREPService
paths:
  /api/v1/namespaces/{namespaceKey}/flags/{key}:
    put:
      tags:
        - Flipt
        - FlagsService
      operationId: updateFlag
      parameters:
        - name: namespaceKey
          in: path
          required: true
          schema:
            type: string
        - name: key
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFlagRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Flag'
components:
  schemas:
    UpdateFlagRequest:
      required:
        - name
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        namespaceKey:
          type: string
        defaultVariantId:
          type: string
        metadata:
          type: object
    Flag:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        variants:
          type: array
          items:
            $ref: '#/components/schemas/Variant'
        namespaceKey:
          type: string
        type:
          enum:
            - VARIANT_FLAG_TYPE
            - BOOLEAN_FLAG_TYPE
          type: string
          format: enum
        defaultVariant:
          $ref: '#/components/schemas/Variant'
        metadata:
          type: object
    Variant:
      type: object
      properties:
        id:
          type: string
        flagKey:
          type: string
        key:
          type: string
        name:
          type: string
        description:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        attachment:
          type: string
        namespaceKey:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````