GitLab API

GitlabTool

Actions1095

Ci_variables → getApiV4ProjectsIdVariablesKey

AI-generated

Summary

Retrieve a single CI/CD variable from a specific GitLab project by its key, optionally filtering by environment scope.

Inputs

  • id (required) — The ID or URL-encoded NAMESPACE/PROJECT_NAME of the GitLab project owned by the authenticated user.
  • key (required) — The key identifier of the CI/CD variable to retrieve.
  • filter[environment_scope] — Optional filter to specify the environment scope of the variable.
  • skipAuthentication — Optionally skip authentication to use a non-authenticated request.
  • baseUrl — The base URL of the GitLab instance, defaults to https://gitlab.com.
  • method — HTTP method for the request, defaults to GET.

Output shape

a single CI/CD variable object associated with the specified project and key

The response contains the variable details if found; if the variable or project does not exist, an error will likely be returned. The environment scope filter refines the variable selection if provided.

Examples

Example 1: Retrieve variable 'MY_VAR' from project with ID '123'

Set 'id' to '123' and 'key' to 'MY_VAR', use default GET method and base URL.

Links

Discussion