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

# Update or rename a variable set

> Full-replace a set's name / keys / versions. Admin only. Renaming a set, or removing/renaming a KEY or a VERSION, that a live definition references returns 409 with the referencing `definition_ids` (D-09). Adding keys/versions is always free. Cross-tenant access returns 404.



## OpenAPI

````yaml /openapi.json put /variables/{set_name}
openapi: 3.1.0
info:
  title: GetDialed Flows API
  version: 0.1.0
servers:
  - url: https://api.getdialed.ai/flows
    description: Production
security: []
paths:
  /variables/{set_name}:
    put:
      tags:
        - variables
      summary: Update or rename a variable set
      description: >-
        Full-replace a set's name / keys / versions. Admin only. Renaming a set,
        or removing/renaming a KEY or a VERSION, that a live definition
        references returns 409 with the referencing `definition_ids` (D-09).
        Adding keys/versions is always free. Cross-tenant access returns 404.
      operationId: update_variable_set_variables__set_name__put
      parameters:
        - name: set_name
          in: path
          required: true
          schema:
            type: string
            title: Set Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableSetUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableSetResponse'
        '401':
          description: Missing or invalid authentication
          content:
            application/json:
              example:
                detail: Authentication required
        '403':
          description: Caller is authenticated but not an admin
          content:
            application/json:
              example:
                detail: Admin role required
        '404':
          description: >-
            No such variable set for this organization (cross-tenant access also
            returns 404)
          content:
            application/json:
              example:
                detail: Variable set not found
        '409':
          description: >-
            Referential guard (D-09) — the detail carries the referencing
            definition_ids.
          content:
            application/json:
              example:
                detail: >-
                  Variable set is referenced by live definitions; update them
                  first
        '422':
          description: >-
            The set/version failed typed-schema validation (D-03/D-04) or a
            storage cap.
          content:
            application/json:
              example:
                detail: >-
                  version 'sales' key 'email': value does not match declared
                  type
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    VariableSetUpdate:
      properties:
        name:
          type: string
          title: Name
        keys:
          items:
            $ref: '#/components/schemas/VariableKeyDTO'
          type: array
          maxItems: 100
          title: Keys
        versions:
          items:
            $ref: '#/components/schemas/VariableVersionDTO'
          type: array
          maxItems: 100
          title: Versions
      type: object
      required:
        - name
      title: VariableSetUpdate
      description: Full-replacement update of a set's name / keys / versions.
    VariableSetResponse:
      properties:
        id:
          type: string
          title: Id
        org_id:
          type: string
          title: Org Id
        name:
          type: string
          title: Name
        keys:
          items:
            $ref: '#/components/schemas/VariableKeyResponse'
          type: array
          title: Keys
        versions:
          items:
            $ref: '#/components/schemas/VariableVersionResponse'
          type: array
          title: Versions
      type: object
      required:
        - id
        - org_id
        - name
        - keys
        - versions
      title: VariableSetResponse
      description: A set with its schema and all versions embedded (Phase 47 D-06).
    VariableKeyDTO:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - object
            - array
            - datetime
          title: Type
        default:
          anyOf:
            - {}
            - type: 'null'
          title: Default
      type: object
      required:
        - name
        - type
      title: VariableKeyDTO
      description: A typed key in a set's schema, with an optional default value (D-04).
    VariableVersionDTO:
      properties:
        name:
          type: string
          title: Name
        values:
          additionalProperties: true
          type: object
          title: Values
      type: object
      required:
        - name
      title: VariableVersionDTO
      description: A named instance of a set's schema supplying values for its keys.
    VariableKeyResponse:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - object
            - array
            - datetime
          title: Type
        default:
          anyOf:
            - {}
            - type: 'null'
          title: Default
      type: object
      required:
        - name
        - type
      title: VariableKeyResponse
    VariableVersionResponse:
      properties:
        name:
          type: string
          title: Name
        values:
          additionalProperties: true
          type: object
          title: Values
      type: object
      required:
        - name
        - values
      title: VariableVersionResponse
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````