Upsert an Instance-Level CI Variable
A 3-step recipe with GitLab. We can help you get access.
Recipe · 3 steps
Upsert an Instance-Level CI Variable
with GitLab
Works with AI assistants
Create or update an instance-level CI/CD variable by key.
- Read the instance variable by key. A 200 means it exists; a 404 means it must be created.
- Update the existing variable's value and protection flags.
- Create a new instance-level variable with the supplied key and value.
What you'll need to have ready
- privateToken: GitLab Private-Token used to authenticate the API calls.
- key: The key of the instance-level variable.
- value: The value to set on the variable.
- protected: Whether the variable is protected.
- masked: Whether the variable is masked.
For your developer
Arazzo workflow gitlab:upsert-instance-ci-variable, 3 operations: getApiV4AdminCiVariablesKey → putApiV4AdminCiVariablesKey → postApiV4AdminCiVariables. Specs on APIs.io.