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

# Update environment variable

> Updates the environment variable identified by its name, modifying its description, value, or encrypted flag, and returns the updated variable. For encrypted variables the value may be left blank to retain the current value.



## OpenAPI

````yaml /schema.json put /environment/variables/{name}
openapi: 3.1.0
info:
  version: 01KV4EC0SHV95TK2YR66AMKFZC
  title: Alumio API
  description: Access Alumio through OpenAPI v3.1.
servers:
  - url: /api/v1
security: []
paths:
  /environment/variables/{name}:
    put:
      tags:
        - Environment
      summary: Update environment variable
      description: >-
        Updates the environment variable identified by its name, modifying its
        description, value, or encrypted flag, and returns the updated variable.
        For encrypted variables the value may be left blank to retain the
        current value.
      operationId: updateEnvironmentVariable
      parameters:
        - name: name
          in: path
          description: Environment variable name
          required: true
          schema:
            type: string
        - name: space
          in: query
          description: Space Identifier
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EnvironmentVariablePatch'
      responses:
        '200':
          description: Updated variable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentVariableResult'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    EnvironmentVariablePatch:
      type: object
      properties:
        description:
          title: Description
          type: string
          maxLength: 150
          ui:
            ui:placeholder: Enter a short description (up to 150 characters).
        encrypted:
          title: Encrypted
          type: boolean
          ui:
            ui:help: Encrypts the environment variable. Value is hidden in logs.
        value:
          type: string
          ui:
            ui:widget: textarea
      dependencies:
        encrypted:
          oneOf:
            - properties:
                encrypted:
                  enum:
                    - true
                value:
                  type: string
                  ui:
                    ui:widget: textarea
                    ui:help: Leave blank to retain the current value.
            - properties:
                encrypted:
                  enum:
                    - false
                value:
                  type: string
                  ui:
                    ui:widget: textarea
              required:
                - value
    EnvironmentVariableResult:
      type: object
      properties:
        object:
          $ref: '#/components/schemas/EnvironmentVariable'
    Error:
      type: object
      properties:
        status:
          type: string
        context:
          type: object
        type:
          type: string
        title:
          type: string
        detail:
          type: string
        violations:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              propertyPath:
                type: string
              type:
                type: string
    EnvironmentVariable:
      type: object
      properties:
        name:
          $ref: '#/components/schemas/EnvironmentVariableName'
        description:
          title: Description
          type: string
          maxLength: 150
        value:
          title: Value
          type: string
        encrypted:
          title: Encrypted
          type: boolean
        default:
          type: boolean
      required:
        - name
    EnvironmentVariableName:
      title: Name
      type: string
      pattern: ^[a-zA-Z0-9_-]+$

````