GitHubApi v3 (REST) - Search for pull request by commit sha in a private organization repository


Using GitHub’s REST API v3 and following documentation listed here and here, I’m trying to search for pull requests that corespond to a specific commit SHA.

The q parameter that I am sending in the request looks like this:


The authentication token used in the request is an application installation token. The application for which the token is generated has the Metadata permission set to ReadOnly, so it should have access to the org’s private repositories, using it on any other endpoint works as intended.

When making the GET call to /search/issues, the response that I’m receiving is:

    "message": "Validation Failed",
    "errors": [
            "message": "The listed users and repositories cannot be searched either because the resources do not exist or you do not have permission to view them.",
            "resource": "Search",
            "field": "q",
            "code": "invalid"
    "documentation_url": ""

Worth noting, using the same query string on the website:

5f2e8a2 repo:owner/repo type:pr is:open

Returns the correct results.

Am I doing something wrong?

Thank you!

Hi @acazacu,

Thank you for being here and apologies for the delay in response. At first look this seems like an authentication error, thought as you’ve shared the token works for other requests. Since this is in a private repository the quickest way to get you help would be to open a support ticket If you haven’t already, please contact us at with the info so we can look into that further.