GitLab API icon

GitLab API

Gitlab

Actions1062

Branches → putApiV4ProjectsIdRepositoryBranchesBranchUnprotect

AI-generated

Summary

Unprotect a specific branch in a GitLab project's repository by making a PUT request to the GitLab API endpoint /api/v4/projects/{id}/repository/branches/{branch}/unprotect.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project containing the branch to unprotect.
  • branch (required) — The name of the branch within the specified project to unprotect.
  • skipAuthentication — Optional boolean to skip authentication; defaults to false.
  • baseUrl — Optional base URL for the GitLab instance; defaults to 'https://gitlab.com'.

Output shape

the response body from the GitLab API call, typically JSON representing the unprotected branch resource

Requires authentication via configured GitLab API credentials unless 'Skip Authentication' is set to true. The operation performs a PUT HTTP method to the path '/api/v4/projects/{id}/repository/branches/{branch}/unprotect'. No request body schema is defined, as the request path parameters specify the target project and branch.

Examples

Example 1: Unprotect the 'develop' branch of project with ID '12345'

Set 'id' parameter to '12345', 'branch' parameter to 'develop', and invoke the operation. The branch will be unprotected, allowing changes without merge requests if branch protection rules existed.

Links

Discussion