Need extra permissions for creating a pull request from octokit/rest api

For “POST /repos/:owner/:repo/pulls” or


I kept getting a “Validation Failed, not all refs are readable” code 422. To fix this I had to add extra permissions for my GitHub bot:
Contents- Read & Write
Issues- Read & Write
Pull Request- Read & Write

However, on the developer docs here, it says that the only permissions that my bot needs to create a PR is pull request with “read & write” permissions, and not the extra content/issues permissions. Is this a mistake / bug with the api or the documentation?

Hi @kevo1ution,

Thank you for being here! Sorry for the trouble here. So that we can identify if the issue is the octokit library, or with the API itself could you please send us the full output of a curl -v request that demonstrates the problem?

That should help us investigate the issue. Also, please make sure you mask any sensitive information like OAuth tokens and Authorization headers in the output of the curl command. Please send the output to And include a link to this thread to give support some background on the ticket.