GitLab API

GitlabTool

Actions1095

Projects → postApiV4ProjectsIdRegistryProtectionRepositoryRules

AI-generated

Summary

Create a new registry protection repository rule for a specified GitLab project by POSTing to the /api/v4/projects/{id}/registry/protection/repository/rules endpoint.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project for which to create the protection repository rule.
  • postApiV4ProjectsIdRegistryProtectionRepositoryRules (required) — The request body object that defines the properties of the new registry protection repository rule to be created.
  • baseUrl — Optional GitLab instance base URL; defaults to https://gitlab.com if not provided.
  • skipAuthentication — Boolean flag to skip authentication if set to true; otherwise uses configured GitLab API credentials.

Output shape

a single JSON object representing the newly created registry protection repository rule

The operation returns the created repository rule object. The response shape follows the GitLab API definition for this resource. Errors or failed requests will return error details according to the GitLab API's standard response schema.

Links

Discussion