Update an instance-level variable

PUT /admin/ci/variables/{key}

Update an instance-level variable

Path parameters

  • key string Required

    The key of a variable

application/json

Body

  • value string

    The value of a variable

  • protected boolean

    Whether the variable is protected

  • masked boolean

    Whether the variable is masked

  • raw boolean

    Whether the variable will be expanded

  • variable_type string

    The type of a variable. Available types are: env_var (default) and file

    Values are env_var or file.

Responses

  • 200 application/json

    Update an instance-level variable

    Hide response attributes Show response attributes object
    • variable_type string
    • key string
    • value string
    • protected boolean
    • masked boolean
    • raw boolean
    • environment_scope string
  • 404

    Instance Variable Not Found

PUT /admin/ci/variables/{key}
curl \
 --request PUT 'https://www.gitlab.com/api/v4/admin/ci/variables/{key}' \
 --header "Private-Token: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"value":"string","protected":true,"masked":true,"raw":true,"variable_type":"env_var"}'
Request examples
{
  "value": "string",
  "protected": true,
  "masked": true,
  "raw": true,
  "variable_type": "env_var"
}
Response examples (200)
{
  "variable_type": "env_var",
  "key": "TEST_VARIABLE_1",
  "value": "TEST_1",
  "protected": true,
  "masked": true,
  "raw": true,
  "environment_scope": "*"
}