Ana içeriğe atla

Endpoint

PUT /apiops/projects/{projectName}/environmentVariables/{name}/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name (can be “admin” for admin project)
namestringYesCurrent environment variable name

Request Body

Same structure as Create Environment Variable. See Create Environment Variable for field descriptions.

Important Notes

  • name in path is the current name (used to find the variable)
  • name in body can be different (to rename the variable)
  • If renaming, new name must be unique
  • All 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 SECRETS + MANAGE permission in the project

Notes and Warnings

  • Name Change:
    • Variable can be renamed by providing different name in body
    • New name must be unique
  • Variable Must Exist:
    • Variable with specified name must exist
  • Automatic Deployment:
    • Variable is automatically deployed after update