GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → putApiV4ProjectsIdHooksHookIdUrlVariablesKey

AI-generated

Summary

Update the value of a specific URL variable key for a project hook in GitLab by specifying the project ID, hook ID, and variable key, along with the new variable data in the request body.

Inputs

  • id (required) — The ID of the project to update the hook URL variable within.
  • hook_id (required) — The ID of the hook associated with the project.
  • key (required) — The key of the URL variable to update.
  • putApiV4ProjectsIdHooksHookIdUrlVariablesKey (required) — The new data for the URL variable key to update in the project's hook, supplied in the request body.
  • baseUrl — Optional base URL for the GitLab instance, defaults to https://gitlab.com.
  • skipAuthentication — Optionally skip authentication for this request.

Output shape

The updated URL variable object corresponding to the specified key within the project hook.

The operation performs an HTTP PUT to the path /api/v4/projects/{id}/hooks/{hook_id}/url_variables/{key}, replacing the existing value of the specified URL variable key with the provided data. Authentication is required unless explicitly skipped via the skipAuthentication flag.

Examples

Example 1: Update a URL variable key 'DEPLOY_ENV' for hook ID 101 in project ID 123 with a new value

Set path parameters id=123, hook_id=101, key='DEPLOY_ENV', and in the request body provide the new value object for this variable.

Links

Discussion