# Get Branch Protection information

**URL:** <https://forum.gitea.com/t/get-branch-protection-information/9455>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [July 16, 2024, 6:56pm UTC](https://forum.gitea.com/t/get-branch-protection-information/9455 "2024-07-16T18:56:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vtlamore1](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@vtlamore1](https://forum.gitea.com/u/vtlamore1)\
**Post date:** [July 16, 2024, 6:56pm UTC](https://forum.gitea.com/t/get-branch-protection-information/9455/1 "2024-07-16T18:56:21Z")

</div>

Gitea: 1.21.4

I am attempting to use the /repos/{owner}/{repo}/branch\_protections API.  
I have tried every combination of owner and repo that I can think of, but it is still not working.

Passing user id for {owner} yields this response, so passing in the username makes sense for {owner}.  
{“errors”:[“user redirect does not exist [name: 1]”],“message”:“GetUserByName”,“url”:“[https://127.0.0.1:3000/api/swagger](https://127.0.0.1:3000/api/swagger)”}

But passing in for {repo};  
The repo ID  
The repo name  
The organization and repo name with %2F in the middle

all yield the same response of:  
{“errors”:null,“message”:“The target couldn’t be found.”,“url”:“[https://127.0.0.1:3000/api/swagger](https://127.0.0.1:3000/api/swagger)”}

What is the format of {repo} supposed to be?

---

<div class="post-metadata">

**Author:** ![vtlamore1](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@vtlamore1](https://forum.gitea.com/u/vtlamore1)\
**Post date:** [July 17, 2024, 1:49pm UTC](https://forum.gitea.com/t/get-branch-protection-information/9455/2 "2024-07-17T13:49:39Z")

</div>

Solved.

{owner} is actually the name of the organization the repo is under, not a user who is in the Owners team.
