RESTv3 documentation for repos/:o/:r/branches

$ curl -H “Authorization: token $(<~/.ghtoken)”



    “name”: “xxx”,

    “commit”: {

      “sha”: “0989xxxxxxx”,

      “url”: “…”




Not a single result shows either “protected”, or “protected_url” fields despite there being branch protection configured for some branches.  Am I missing a mediatype for the API?  The documentation ( does not specify one.

I started looking at this because I was unable to get the branch protection for a wildcard branch created with the UI although when checking a branch matching the wildcard, I was able to see the correct protection, but no indication that it was created using a wildcard.  Are wildcards unsupported in the REST v3 API at the moment?

1 Like

Aha, I see that protected, protection_url and the undocumented “protection” are returned but only if you specify protected=true.  That’s not as intuitive as I’d hope.  The question about wildcards still stands, however.


1 Like