---
title: "Edit an environment variable belonging to the application"
method: PUT
path: "/application/{applicationId}/environmentVariable/{environmentVariableId}"
tags: ["Application Environment Variable"]
---

# Edit an environment variable belonging to the application

`PUT /application/{applicationId}/environmentVariable/{environmentVariableId}`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/application/{applicationId}/environmentVariable/{environmentVariableId}`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/application/:applicationId/environmentVariable/:environmentVariableId/put.ts> (a function with typed inputs; its response is checked against the schema)

- You can't edit a BUILT_IN variable
- For an override, you can't edit the key
- For an alias, you can't edit the value
- An override can only have a scope lower to the variable it is overriding (hierarchy is BUILT_IN > PROJECT > ENVIRONMENT > APPLICATION)

## Path parameters

- `applicationId` string, uuid, required
- `environmentVariableId` string, uuid, required

## Request body

- EnvironmentVariableEditRequest
  - `key` string, required: key is case sensitive
  - `value` string: value of the env variable.
  - `mount_path` string, nullable
  - `description` string, nullable: optional variable description (255 characters maximum)
  - `enable_interpolation_in_file` boolean, nullable

## Response `200`

Edited the environment variable value

- EnvironmentVariable
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time
  - `key` string, required: key is case sensitive.
  - `value` string: value of the env variable.
  - `mount_path` string, nullable: should be set for file only. variable mount path makes variable a file (where file should be mounted).
  - `description` string, nullable: optional variable description (255 characters maximum)
  - `enable_interpolation_in_file` boolean, nullable
  - `overridden_variable` EnvironmentVariableOverride
    - `id` string, uuid, required
    - `key` string, required
    - `value` string, required
    - `mount_path` string, required
    - `scope` 'APPLICATION' | 'BUILT_IN' | 'ENVIRONMENT' | 'PROJECT' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required
    - `variable_type` 'VALUE' | 'ALIAS' | 'OVERRIDE' | 'BUILT_IN' | 'FILE', required: type of the environment variable (VALUE, FILE, ALIAS, OVERRIDE or BUIT_IN)
  - `aliased_variable` EnvironmentVariableAlias
    - `id` string, uuid, required
    - `key` string, required
    - `value` string, required
    - `mount_path` string, required
    - `scope` 'APPLICATION' | 'BUILT_IN' | 'ENVIRONMENT' | 'PROJECT' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required
    - `variable_type` 'VALUE' | 'ALIAS' | 'OVERRIDE' | 'BUILT_IN' | 'FILE', required: type of the environment variable (VALUE, FILE, ALIAS, OVERRIDE or BUIT_IN)
  - `scope` 'APPLICATION' | 'BUILT_IN' | 'ENVIRONMENT' | 'PROJECT' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required
  - `variable_type` 'VALUE' | 'ALIAS' | 'OVERRIDE' | 'BUILT_IN' | 'FILE', required: type of the environment variable (VALUE, FILE, ALIAS, OVERRIDE or BUIT_IN)
  - `service_id` string, uuid
  - `service_name` string
  - `service_type` 'APPLICATION' | 'CONTAINER' | 'DATABASE' | 'JOB' | 'HELM' | 'TERRAFORM': type of the service (application, database, job, gateway...)
  - `owned_by` string: Entity that created/own the variable (i.e: Qovery, Doppler)

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `404`: Resource not found

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
