curl --request GET \
--url https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-coderabbitai-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"number": 4503599627370495,
"url": "<string>",
"title": "<string>",
"repository": "<string>",
"author": {
"login": "<string>"
},
"state": "open",
"draft": true,
"head_branch": "<string>",
"head_owner": "<string>",
"base_branch": "<string>",
"head_sha": "<string>",
"base_sha": "<string>",
"updated_at": "<string>"
}
],
"next_page_token": "<string>",
"fetched_at": "<string>",
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"applied_filters": {
"repository_id": "<string>",
"page_size": 50,
"author": "me",
"state": "open",
"head_branch": "<string>",
"head_owner": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 4503599627370495
}
}List an accessible repository's pull requests
Uses current-user repository access. Results are a live provider search: follow next_page_token even after an empty page and retain the same filters. Defaults to the linked user’s open pull requests.
curl --request GET \
--url https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests"
headers = {"x-coderabbitai-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-coderabbitai-api-key': '<api-key>'}};
fetch('https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-coderabbitai-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests")
.header("x-coderabbitai-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"number": 4503599627370495,
"url": "<string>",
"title": "<string>",
"repository": "<string>",
"author": {
"login": "<string>"
},
"state": "open",
"draft": true,
"head_branch": "<string>",
"head_owner": "<string>",
"base_branch": "<string>",
"head_sha": "<string>",
"base_sha": "<string>",
"updated_at": "<string>"
}
],
"next_page_token": "<string>",
"fetched_at": "<string>",
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"applied_filters": {
"repository_id": "<string>",
"page_size": 50,
"author": "me",
"state": "open",
"head_branch": "<string>",
"head_owner": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 4503599627370495
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 4503599627370495
}
}Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Path Parameters
^[1-9]\d*$Query Parameters
me means the linked GitHub account; all means any author; otherwise supply a GitHub login.
^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$open, closed, merged, all Exact source branch name. Combine with head_owner to distinguish forks; all matches remain visible.
1 - 255^[^\s"\\]+$Owner login of the source repository, including a fork.
^[A-Za-z0-9][A-Za-z0-9-]{0,38}(?:\[bot\])?$Git-provider organization ID. Required for workspace keys; omit for organization keys.
1Provider records scanned per page; defaults to 20. A short or empty page can have a continuation.
1 <= x <= 100Use next_page_token with the same principal, repository and filters. Expires after ten minutes.
1 - 4096Was this page helpful?