ci_variables

Create instance variable

Creates a instance-level variable. The maximum number of instance-level variables can be changed.

post/api/v4/admin/ci/variables

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Request body

keystring required

The key of the variable. Max 255 characters

descriptionstring

The description of the variable

valuestring required

The value of a variable

protectedboolean

Whether the variable is protected

maskedboolean

Whether the variable is masked

rawboolean

Whether the variable will be expanded

variable_type'env_var' | 'file'

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

Response

Create instance variable

variable_typestring required
keystring required
valuestring required
hiddenboolean
protectedboolean
maskedboolean
rawboolean
environment_scopestring
descriptionstring

Example response

{
  "variable_type": "env_var",
  "key": "TEST_VARIABLE_1",
  "value": "TEST_1",
  "environment_scope": "*",
  "description": "This variable is being used for ..."
}

Changes

No recorded changes to this operation across all 5 revisions of this API.