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

# Create App Variable

> Create a variable for a specific app.



## OpenAPI

````yaml post /apps/{app_id}/variables
openapi: 3.0.0
info:
  version: 1.0.0
  title: API
servers: []
security: []
paths:
  /apps/{app_id}/variables:
    post:
      summary: Create App Variable
      description: Create a variable for a specific app.
      parameters:
        - schema:
            type: string
          required: true
          description: The ID of the app
          name: app_id
          in: path
      requestBody:
        description: The new variable information.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppVariableSchema'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateAppVariableSchema'
      responses:
        '200':
          description: The created app variable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppVariableSchema'
components:
  schemas:
    CreateAppVariableSchema:
      type: object
      properties:
        key:
          type: string
          maxLength: 128
          pattern: ^[a-zA-Z_][a-zA-Z_0-9]*$
          description: The key of the app variable
        value:
          type: string
          maxLength: 2048
          description: The value of the app variable
        secret:
          type: boolean
          description: Indicates if the variable is a secret
          example: true
      required:
        - key
      description: Detailed information about a variable in your app
    AppVariableSchema:
      type: object
      properties:
        key:
          type: string
          maxLength: 128
          pattern: ^[a-zA-Z_][a-zA-Z_0-9]*$
          description: The key of the app variable
        value:
          type: string
          maxLength: 2048
          description: The value of the app variable
        secret:
          type: boolean
          description: Indicates if the variable is a secret
          example: true
      required:
        - key
      description: Detailed information about a variable in your app

````