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

# Update Environment Variables

> Set or update environment variables inside the workspace.



## OpenAPI

````yaml POST /api/v1/workspaces/{id}/env
openapi: 3.1.0
info:
  title: Rigbox Public API
  description: >-
    Gateway-owned public API for Rigbox. The gateway composes its local
    lifecycle API with service-owned exported specs.
  contact:
    name: Rigbox
    url: https://rigbox.dev
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.rigbox.dev
    description: Production gateway
security: []
tags:
  - name: Workspaces
  - name: CLI
  - name: Observability
  - name: Auth
  - name: API Keys
  - name: Access Control
  - name: Apps
  - name: App Catalog
  - name: Logs
  - name: AI
  - name: Tools
  - name: Snapshots
  - name: SSH Keys
  - name: Templates
  - name: Setup Scripts
  - name: Service Specs
  - name: Deploy
  - name: Community
  - name: User Settings
  - name: Roadmap
  - name: System
paths:
  /api/v1/workspaces/{id}/env:
    post:
      tags:
        - Workspaces
      summary: |-
        Update environment variables for a workspace.
        Changes take effect immediately if the workspace is running.
      description: >-
        Replace workspace environment variables; a running workspace picks up
        changes immediately.
      operationId: update_workspace_env
      parameters:
        - name: id
          in: path
          description: Workspace ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceEnvRequest'
        required: true
      responses:
        '200':
          description: Environment variables updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
      security:
        - bearer: []
components:
  schemas:
    UpdateWorkspaceEnvRequest:
      type: object
      required:
        - env_vars
      properties:
        env_vars:
          type: object
          additionalProperties:
            type: string
          propertyNames:
            type: string
    MessageResponse:
      type: object
      description: Generic success envelope - used across all domains.
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````