> ## 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.

# Add a version to a set

> Add a named version to an existing set. Admin only. Returns 422 when the version is missing a no-default key or supplies a wrong-typed value (D-03/D-04). Cross-tenant access returns 404.



## OpenAPI

````yaml /openapi.json post /variables/{set_name}/versions
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}/versions:
    post:
      tags:
        - variables
      summary: Add a version to a set
      description: >-
        Add a named version to an existing set. Admin only. Returns 422 when the
        version is missing a no-default key or supplies a wrong-typed value
        (D-03/D-04). Cross-tenant access returns 404.
      operationId: add_version_variables__set_name__versions_post
      parameters:
        - name: set_name
          in: path
          required: true
          schema:
            type: string
            title: Set Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableVersionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableVersionResponse'
        '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
        '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:
    VariableVersionCreate:
      properties:
        name:
          type: string
          title: Name
        values:
          additionalProperties: true
          type: object
          title: Values
      type: object
      required:
        - name
      title: VariableVersionCreate
      description: Add / replace a single version under an existing set.
    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

````