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

# Update Variant

> Updates a variant of a flag. The updated variant must satisfy the schema
 of the flag.



## OpenAPI

````yaml /api/flags/api/flag.openapi.json patch /v1/flags/{flag}/variants/{variant}
openapi: 3.1.0
info:
  title: Confidence Flag API
  version: 1.0.0
  description: API documentation for flag
servers: []
security: []
paths:
  /v1/flags/{flag}/variants/{variant}:
    patch:
      summary: Update Variant
      description: |-
        Updates a variant of a flag. The updated variant must satisfy the schema
         of the flag.
      operationId: Variant.update
      parameters:
        - name: flag
          in: path
          required: true
          schema:
            type: string
        - name: variant
          in: path
          required: true
          schema:
            type: string
        - name: updateMask
          in: query
          required: false
          description: >-
            The list of fields in Variant that you want to update e.g.
            'description',
             if empty all mutable properties are updated.
             Fields are specified relative to the variant.
          schema:
            type: object
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: |-
                    The resource name of the variant.
                     For example:
                     `flags/my-flag/variants/control`
                value:
                  type: object
                  description: >-
                    The value that this variant represents. A possibly nested
                    json object.
                labels:
                  type: array
                  items:
                    type: object
                    additionalProperties:
                      type: string
                  description: General set of labels for this resource.
                description:
                  type: string
                  description: A human-friendly description of the variant.
                imageUri:
                  type: string
                  description: An image URL or path for the variant.
              required:
                - name
                - value
        required: true
      responses:
        '200':
          description: Returns a [Flag.Variant](/api-reference/schemas/flag-variant).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/confidence.flags.admin.v1.Flag.Variant'
      security:
        - admin: []
      servers:
        - url: https://flags.eu.confidence.dev
        - url: https://flags.us.confidence.dev
        - url: https://flags.confidence.dev
components:
  schemas:
    confidence.flags.admin.v1.Flag.Variant:
      title: Flag.Variant
      type: object
      description: A possible named value the flag can assign.
      properties:
        name:
          type: string
          description: |-
            The resource name of the variant.
             For example:
             `flags/my-flag/variants/control`
        value:
          type: object
          description: >-
            The value that this variant represents. A possibly nested json
            object.
        labels:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
          description: General set of labels for this resource.
        description:
          type: string
          description: A human-friendly description of the variant.
        imageUri:
          type: string
          description: An image URL or path for the variant.
        createTime:
          type: object
          description: Time when the flag was first created.
        updateTime:
          type: object
          description: Time when the flag was last updated.
        creator:
          type: string
          description: Reference to the identity that created this variant.
        updater:
          type: string
          description: Reference to the identity that last updated this variant.
      required:
        - name
        - value
        - createTime
        - updateTime
        - creator
        - updater
  securitySchemes:
    admin:
      type: http
      scheme: bearer

````