Skip to content

Update an instance variable

PUT
/api/v4/admin/ci/variables/{key}

Updates a specified instance variable.

key
required
string

The key of a variable

Media type application/json
object
description

The description of the variable

string
nullable
value

The value of a variable

string
nullable
protected

Whether the variable is protected

boolean
nullable
masked

Whether the variable is masked

boolean
nullable
raw

Whether the variable will be expanded

boolean
nullable
variable_type

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

string
nullable
Allowed values: env_var file

OK

Media type application/json
object
variable_type
string
key
string
value
string
hidden
boolean
protected
boolean
masked
boolean
raw
boolean
environment_scope
string
description
string
Example
{
"variable_type": "env_var",
"key": "TEST_VARIABLE_1",
"value": "TEST_1",
"environment_scope": "*",
"description": "This variable is being used for ..."
}

Bad Request

Instance Variable Not Found