| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
| `value` | string | yes | The `value` of a variable |
| `protected` | boolean | no | Whether the variable is protected |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
| `value` | string | yes | The `value` of a variable |
| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
| `protected` | boolean | no | Whether the variable is protected |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `value` | string | yes | The `value` of a variable |
| `protected` | boolean | no | Whether the variable is protected |
| `id` | integer/string | yes | The ID of a group or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `value` | string | yes | The `value` of a variable |
| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
| `protected` | boolean | no | Whether the variable is protected |
```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/variables/NEW_VARIABLE" --form "value=updated value"
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `ref` | string | yes | Reference to commit |
| `variables` | array | no | An array containing the variables available in the pipeline, matching the structure [{ 'key' => 'UPLOAD_TO_S3', 'value' => 'true' }] |
| `variables` | array | no | An array containing the variables available in the pipeline, matching the structure [{ 'key' => 'UPLOAD_TO_S3', 'variable_type' => 'file', 'value' => 'true' }] |
```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/pipeline?ref=master"
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
| `value` | string | yes | The `value` of a variable |
| `protected` | boolean | no | Whether the variable is protected |
| `environment_scope` | string | no | The `environment_scope` of the variable |
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable; must have no more than 255 characters; only `A-Z`, `a-z`, `0-9`, and `_` are allowed |
| `value` | string | yes | The `value` of a variable |
| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
| `protected` | boolean | no | Whether the variable is protected |
| `environment_scope` | string | no | The `environment_scope` of the variable |
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `value` | string | yes | The `value` of a variable |
| `protected` | boolean | no | Whether the variable is protected |
| `environment_scope` | string | no | The `environment_scope` of the variable |
| `id` | integer/string | yes | The ID of a project or [urlencoded NAMESPACE/PROJECT_NAME of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `key` | string | yes | The `key` of a variable |
| `value` | string | yes | The `value` of a variable |
| `variable_type` | string | no | The type of a variable. Available types are: `env_var` (default) and `file` |
| `protected` | boolean | no | Whether the variable is protected |
| `environment_scope` | string | no | The `environment_scope` of the variable |
```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/variables/NEW_VARIABLE" --form "value=updated value"
requires:key,type: String,desc: 'The key of the variable'
requires:value,type: String,desc: 'The value of the variable'
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:variable_type,type: String,values: Ci::GroupVariable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file. Defaults to env_var'
requires:pipeline_schedule_id,type: Integer,desc: 'The pipeline schedule id'
requires:key,type: String,desc: 'The key of the variable'
requires:value,type: String,desc: 'The value of the variable'
optional:variable_type,type: String,values: Ci::PipelineScheduleVariable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file. Defaults to env_var'
requires:pipeline_schedule_id,type: Integer,desc: 'The pipeline schedule id'
requires:key,type: String,desc: 'The key of the variable'
optional:value,type: String,desc: 'The value of the variable'
optional:variable_type,type: String,values: Ci::PipelineScheduleVariable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file'
requires:key,type: String,desc: 'The key of the variable'
requires:value,type: String,desc: 'The value of the variable'
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:variable_type,type: String,values: Ci::Variable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file. Defaults to env_var'
ifGitlab.ee?
optional:environment_scope,type: String,desc: 'The environment_scope of the variable'
...
...
@@ -80,6 +81,7 @@ module API
optional:key,type: String,desc: 'The key of the variable'
optional:value,type: String,desc: 'The value of the variable'
optional:protected,type: String,desc: 'Whether the variable is protected'
optional:variable_type,type: String,values: Ci::Variable.variable_types.keys,desc: 'The type of variable, must be one of env_var or file'
ifGitlab.ee?
optional:environment_scope,type: String,desc: 'The environment_scope of the variable'