Skip to main content
Permanently deletes a branch and all of its versions (hard delete).
DELETE /api/v2/repos/{team}/{repo}/branches/{branchId}
Authorization: Bearer YOUR_JWT_TOKEN

Path Parameters

ParameterTypeDescription
teamRequiredTeam or organization name
repoRequiredRepository name
branchIdRequiredUnique identifier of the branch to permanently delete

JWT Requirements

  • Requires git:write scope
  • JWT must include the repository in the repo claim

Response

{
  "message": "Branch permanently deleted",
  "branch_id": "branch_123",
  "permanent": true
}

Notes

  • This is a permanent deletion - the branch and all its versions are completely removed
  • The branch cannot be restored after this operation
  • Use with caution as this operation is irreversible

Error Responses

StatusDescription
404 Not FoundBranch doesn’t exist
401 UnauthorizedInvalid JWT or missing git:write scope