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

# Create a variable set

> Create an account-variable set (schema + versions). Admin only. Returns 422 on typed-schema violation (D-03/D-04) or when the account is already at the maximum number of sets; 409 on a duplicate set name.



## OpenAPI

````yaml /openapi.json post /variables
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:
    post:
      tags:
        - variables
      summary: Create a variable set
      description: >-
        Create an account-variable set (schema + versions). Admin only. Returns
        422 on typed-schema violation (D-03/D-04) or when the account is already
        at the maximum number of sets; 409 on a duplicate set name.
      operationId: create_variable_set_variables_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableSetCreate'
      responses:
        '201':
          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
        '409':
          description: Duplicate set name for this org
          content:
            application/json:
              example:
                detail: VariableSet already exists
        '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:
    VariableSetCreate:
      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: VariableSetCreate
      description: 'Create-a-set payload: schema (keys) + named versions, capped.'
    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

````