GET branch protection returning 404 #24582
-
I’m trying to use the Github API to look at branch protection on a public repo. I’m doing a GET request (via Postman but also tried via curl) to the following: With the headers:
However, I keep getting the following 404 response:
Anyone got any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Can you check whether the user is an admin for that repo? Or is he in a team that has admin access to the repo? Because branch protection is something that is restricted. In the below example you can see that I can able to get the master branch details but I cannot get the branch protection details since I am not the admin for that repo. Regards Parithiban G |
Beta Was this translation helpful? Give feedback.
-
Yes, my mistake, I didn’t realise that just viewing branch protection required authorized user. Issue resolved now. |
Beta Was this translation helpful? Give feedback.
@jopintopaul
Can you check whether the user is an admin for that repo? Or is he in a team that has admin access to the repo? Because branch protection is something that is restricted.
In the below example you can see that I can able to get the master branch details but I cannot get the branch protection details since I am not the admin for that repo.
Regards
Parithiban G