GitLab API icon

GitLab API

Gitlab

Actions1062

Ci_variables → getApiV4ProjectsIdVariablesKey

AI-generated

Summary

Retrieve a specific CI variable by its key from a GitLab project identified by its ID or URL-encoded path.

Inputs

  • id (required) — The ID of a project or URL-encoded NAMESPACE/PROJECT_NAME of the project owned by the authenticated user.
  • key (required) — The key of the variable to retrieve.
  • filter[environment_scope] — Optional environment scope filter for the variable.
  • baseUrl — The base URL of the GitLab instance; defaults to https://gitlab.com.
  • skipAuthentication — Optionally skip authentication; defaults to false (authentication used).

Output shape

a single CI variable object representing the variable with the specified key from the given project.

The response contains the CI variable details matching the key for the specified project. An optional environment scope filter can narrow the variable retrieved. Authentication is required unless explicitly skipped.

Examples

Example 1: Get a CI variable called 'DEPLOY_TOKEN' from project ID 12345

Set Path Parameters id to '12345' and key to 'DEPLOY_TOKEN', leave other parameters as defaults.

Links

Discussion