title: How to use "Pull Request Query"?
body: <p>I want to return a pull request based on a commit. I found this > <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20query/get?view=azure-devops-rest-5.1" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20request%20query/get?view=azure-devops-rest-5.1</a></p>
  
  <blockquote>
    <p>This API is used to find what pull requests are related to a given commit.</p>
  </blockquote>
  
  <p>I'm using the following code:</p>
  
  <pre><code>$body = @"
  {
      "items": [
          {
              "59c1c31397b266116ff6d735e5638ef5d1b598a0"
          }
      ]
  }
  "@ 
  
  $someLink = "https://dev.something.com/embrace/somethingSomething/_apis/git/repositories/****-bf64-47d9-8b10-53f21220d54d/pullrequestquery?api-version=5.1"
  Invoke-RestMethod -Uri $someLink -Headers @{Authorization = $pat } -Body $body -Method Post -ContentType 'application/json'
  </code></pre>
  
  <p>When I run the release I get a:</p>
  
  <blockquote>
    <p>The remote server returned an error: (400) Bad Request.</p>
  </blockquote>