GitLab API

GitlabTool

Actions1095

Projects → deleteApiV4ProjectsIdProtectedBranchesName

AI-generated

Summary

Delete a protected branch from a specified GitLab project by providing the project ID or URL-encoded path and the branch name.

Inputs

  • id (required) — The ID or URL-encoded path of the project from which to delete the protected branch.
  • name (required) — The name of the protected branch to delete.
  • baseUrl — The GitLab instance base URL; defaults to 'https://gitlab.com' if not set.
  • skipAuthentication — Option to skip authentication for the request, default is false.

Output shape

no body — success/failure only

This operation returns no content on success; it deletes the protected branch specified. Errors will be returned if the project or branch does not exist or if authentication fails.

Examples

Example 1: Delete the protected branch 'main' from project with ID 'gitlab-org/gitlab'.

Set 'id' to 'gitlab-org/gitlab' and 'name' to 'main', then execute the DELETE method on path '/api/v4/projects/{id}/protected_branches/{name}'.

Links

Discussion