Update Environment Variable
Endpoint
PUT /apiops/projects/{projectName}/environmentVariables/{name}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name (can be "admin" for admin project) |
| name | string | Yes | Current environment variable name |
Request Body
Same structure as Create Environment Variable. See Create Environment Variable for field descriptions.
Important Notes
- Path
{name}identifies the variable to update; backend always keeps this name (rename is not supported) namein the body should match the path for consistency- Description,
global, values, and visibility fields can be updated
Response
Same as Create Environment Variable. See Create Environment Variable for response format.
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/environmentVariables/API_BASE_URL/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "API_BASE_URL",
"description": "Updated base URL",
"global": false,
"environmentValueList": [
{
"environmentName": "production",
"value": "https://new-api.production.example.com",
"visible": true
}
]
}'
Permissions
User must have GLOBAL_SETTINGS + MANAGE permission in the project. See Environment Variables API for read vs write permissions.
Notes and Warnings
-
Name is fixed:
- Variable name comes from the path parameter
{name} - APIops does not support renaming via a different body
name
- Variable name comes from the path parameter
-
Variable Must Exist:
- Variable with the path name must exist (400 if not found)
-
Value semantics — omitting versus clearing:
- Send values as plain text; every value is encrypted before it is stored, whether or not it is marked Secret
- Omitting a value (
null) KEEPS the stored value. This is how a Secret value survives an update, since read endpoints never return it - Sending an empty string (
"") CLEARS the value
-
Automatic Deployment:
- Variable is automatically deployed after update
Related Documentation
- Create Environment Variable - Create a new environment variable
- Delete Environment Variable - Delete an environment variable