---
title: "Update the priorities of branch protections for a repository."
method: POST
path: "/repos/{owner}/{repo}/branch_protections/priority"
tags: ["repository"]
---

# Update the priorities of branch protections for a repository.

`POST /repos/{owner}/{repo}/branch_protections/priority`

## Request

- Base URL: `https://demo.gitea.com/api/v1`
- URL: `https://demo.gitea.com/api/v1/repos/{owner}/{repo}/branch_protections/priority`
- Auth: one of:
  - HTTP basic
  - API key in query parameter `token`
  - API key in query parameter `access_token`
  - API key in header `Authorization`
  - API key in query parameter `sudo`
  - API key in header `Sudo`
  - API key in header `X-GITEA-OTP`
- TypeScript: <https://skmtc.dev/gitea/apis/gitea-api/docs/repos/:owner/:repo/branch_protections/priority/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- UpdateBranchProtectionPriories: UpdateBranchProtectionPriories a list to update the branch protection rule priorities
  - `ids` integer[]

## Response `204`

APIEmpty is an empty response

## Other responses

- `default`: APIError is error format response

## Changes

- **2026-10-28** `7ef50c4c527f`: 3 info
  - removed the non-success response with the status `404`
  - removed the non-success response with the status `422`
  - removed the non-success response with the status `423`
- **2025-05-20** `4ff3544d6eb3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gitea/apis/gitea-api/changes/repos/:owner/:repo/branch_protections/priority/post.md)

---

[API](https://skmtc.dev/gitea/apis/gitea-api.md) - [All operations](https://skmtc.dev/gitea/apis/gitea-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitea/apis/gitea-api/revisions/7ef50c4c527f?raw)
