GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → postApiV4ProjectsIdPackagesProtectionRules

AI-generated

Summary

Create a new package protection rule for a specified GitLab project to control access to packages within that project.

Inputs

  • Id - The ID or URL-encoded path of the project to which the package protection rule will be added (required). (required) — Specify the unique project identifier or its URL-encoded path.
  • Request Body - The configuration details of the package protection rule to create (required). (required) — Provide the rule's parameters as defined by GitLab's postApiV4ProjectsIdPackagesProtectionRules schema to configure the new protection rule.

Output shape

a JSON object representing the created package protection rule returned by GitLab's API.

The operation returns the newly created package protection rule details as received from the GitLab API endpoint POST /api/v4/projects/{id}/packages/protection/rules. Ensure the project Id and request body conform to GitLab API requirements.

Links

Discussion