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

> ## Agent Instructions
> These are Ditto's developer docs. Ditto is a single source of truth for product copy across design, review, localization, and code.
> The first step on any codebase is a scan: https://developer.dittowords.com/get-started/scan-your-repo.md. That page also covers reviewing the style guide Ditto drafts from the scan. After it, the follow-on guides are Connect Figma files and Set up localization (under /guides/) and Connect the Ditto MCP (the Setup page of the MCP reference).
> Two different MCP servers: the Ditto MCP server at https://api.dittowords.com/v2/mcp gives an agent a workspace's text and style guide rules; the documentation MCP server at https://developer.dittowords.com/mcp searches these docs.
> Prefer logging in with a Ditto account (npx -y @dittowords/cli@latest login; OAuth in MCP clients) over API keys. API keys are for CI and headless clients only.
> Commands are complete as written and use npx -y @dittowords/cli@latest; nothing needs a global install.

# Update variants

> Updates one or more variants in the workspace, identified by their current developer IDs.

Only provided fields are modified. The whole batch is rejected if any update is invalid.



## OpenAPI

````yaml openapi.json patch /variants
openapi: 3.0.0
info:
  version: 1.0.0
  title: Ditto API
  description: Programmatically read and write data in your Ditto workspace.
servers:
  - url: https://api.dittowords.com/v2
security: []
paths:
  /variants:
    patch:
      tags:
        - Variants
      summary: Update variants
      description: >-
        Updates one or more variants in the workspace, identified by their
        current developer IDs.


        Only provided fields are modified. The whole batch is rejected if any
        update is invalid.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                updates:
                  type: array
                  items:
                    type: object
                    properties:
                      developerId:
                        type: string
                        description: The variant's current developer ID
                      name:
                        type: string
                        minLength: 1
                        description: >-
                          New name for the variant. If not provided, the name is
                          unchanged.
                      newDeveloperId:
                        type: string
                        minLength: 1
                        description: >-
                          A new developer ID for this variant. Must be unique
                          within the workspace, and is accepted in any casing
                          and stored lowercase. Renaming a variant does not
                          change its developer ID, so set this only when the key
                          used to refer to the variant should change too. No
                          text is lost or orphaned: text items and library
                          components reference a variant by an internal id, not
                          its developer ID. What has to be updated to match is
                          outside Ditto — CLI output, integration configs, and
                          code naming the old developer ID. Can be set alongside
                          other field changes in the same update object.
                      description:
                        type: string
                        description: >-
                          New description for the variant. Pass an empty string
                          to clear it. If not provided, unchanged.
                      localeCode:
                        type: string
                        nullable: true
                        enum:
                          - af
                          - ar
                          - ar-ae
                          - ar-bh
                          - ar-dz
                          - ar-eg
                          - ar-iq
                          - ar-jo
                          - ar-kw
                          - ar-lb
                          - ar-ly
                          - ar-ma
                          - ar-om
                          - ar-qa
                          - ar-sa
                          - ar-sy
                          - ar-tn
                          - ar-ye
                          - az
                          - be
                          - bg
                          - bs
                          - ca
                          - cs
                          - cy
                          - da
                          - de
                          - de-at
                          - de-ch
                          - de-li
                          - de-lu
                          - el
                          - en
                          - en-au
                          - en-bz
                          - en-ca
                          - en-gb
                          - en-ie
                          - en-jm
                          - en-nz
                          - en-sg
                          - en-tt
                          - en-us
                          - en-za
                          - es
                          - es-ar
                          - es-bo
                          - es-cl
                          - es-co
                          - es-cr
                          - es-do
                          - es-ec
                          - es-gt
                          - es-hn
                          - es-mx
                          - es-ni
                          - es-pa
                          - es-pe
                          - es-pr
                          - es-py
                          - es-sv
                          - es-uy
                          - es-ve
                          - et
                          - eu
                          - fa
                          - fi
                          - fo
                          - fr
                          - fr-be
                          - fr-ca
                          - fr-ch
                          - fr-lu
                          - ga
                          - gd
                          - he
                          - hi
                          - hr
                          - hu
                          - hy
                          - id
                          - is
                          - it
                          - it-ch
                          - ja
                          - ka
                          - kk
                          - ko
                          - ku
                          - lt
                          - lv
                          - mk
                          - ml
                          - ms
                          - mt
                          - nb
                          - nl
                          - nl-be
                          - nn
                          - 'no'
                          - pa
                          - pl
                          - pt
                          - pt-br
                          - rm
                          - ro
                          - ro-md
                          - ru
                          - ru-md
                          - sk
                          - sl
                          - sq
                          - sr
                          - sv
                          - sv-fi
                          - th
                          - tn
                          - tr
                          - ts
                          - uk
                          - ur
                          - ve
                          - vi
                          - wen
                          - xh
                          - yi
                          - zh-cn
                          - zh-hk
                          - zh-sg
                          - zh-tw
                          - zu
                          - null
                        description: >-
                          Locale code for the variant, from the set Ditto
                          supports. Casing does not matter on the way in —
                          'fr-CA' and 'fr-ca' are both accepted — and the code
                          is stored lowercase, which is the form reads return.
                          Not every language-region pairing exists in the set,
                          so pick one of the listed values rather than composing
                          your own. At most one variant per workspace can hold a
                          given locale code. Set this whenever the variant
                          represents a language: translation tools treat it as
                          the authoritative target locale. Moving a locale onto
                          a different variant re-points the variant-scoped style
                          guides and AI translation targeting that resolve a
                          locale to a variant. Pass null to clear it. If not
                          provided, unchanged.
                    required:
                      - developerId
                  minItems: 1
                  description: Array of updates to variants
              required:
                - updates
              example:
                updates:
                  - developerId: spanish
                    description: Spanish translations for Mexico
                    localeCode: es-mx
                  - developerId: fr-ca
                    name: French (Canada)
                    newDeveloperId: french-canada
      responses:
        '200':
          description: Returns success status of the update operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the update was successful
                required:
                  - success
                example:
                  success: true
        '400':
          description: >-
            Returned when the request body fails validation. Common causes
            include: an update that changes nothing; the same value being
            claimed by two updates in one request; a reserved developer ID.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: 'Duplicate new developer IDs in request: french-canada'
        '404':
          description: >-
            Returned when a developer ID does not match any existing variant in
            the workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: 'Variants not found: spanish'
        '409':
          description: >-
            Returned when a name, developer ID, or locale code an update claims
            is already held by another variant in the workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the conflict
                required:
                  - message
              example:
                message: >-
                  Couldn't update variant "spanish": Variant with same name
                  already exists!
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.