Read an accessible pull request and its current checks
curl --request GET \
--url https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests/{pull_request_number} \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests/{pull_request_number}"
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/{pull_request_number}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"pull_request": {
"id": "<string>",
"number": 1,
"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>",
"description": "<string>"
},
"reviews": {
"decision": "<string>",
"items": [
{
"author": {
"login": "<string>"
},
"state": "<string>",
"commit_sha": "<string>"
}
],
"complete": true,
"coderabbit": {
"status": "in_progress_observed",
"reviewed_sha": "<string>",
"source_url": "<string>"
}
},
"merge": {
"mergeable": "mergeable",
"provider_state": "<string>",
"queue_entry": "<string>",
"queue_known": true,
"requirements_known": true,
"applicable": true
},
"blockers": [
{
"kind": "<string>",
"source": "<string>"
}
],
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"head_sha": "<string>",
"fetched_at": "<string>",
"head_changed": true,
"expected_head_sha": "<string>",
"checks": {
"items": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"conclusion": "<string>",
"details_url": "<string>",
"commit_sha": "<string>",
"required": true
}
],
"complete": true,
"requiredness_known": true
},
"threads": {
"returned": 1,
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"head_sha": "<string>",
"fetched_at": "<string>",
"head_changed": true,
"data": [
{
"id": "<string>",
"path": "<string>",
"line": 123,
"start_line": 123,
"original_line": 123,
"original_start_line": 123,
"side": "<string>",
"resolved": true,
"outdated": true,
"root": {
"id": "<string>",
"author": {
"login": "<string>"
},
"body": "<string>",
"url": "<string>",
"created_at": "<string>",
"commit_sha": "<string>",
"original_commit_sha": "<string>"
},
"replies": [
{
"id": "<string>",
"author": {
"login": "<string>"
},
"body": "<string>",
"url": "<string>",
"created_at": "<string>",
"commit_sha": "<string>",
"original_commit_sha": "<string>"
}
],
"replies_complete": true,
"reply_count": 1
}
],
"next_cursor": "<string>",
"applied_filters": {
"limit": 50,
"author": "coderabbit",
"state": "unresolved",
"include_outdated": false,
"include_replies": true
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 1
}
}Read an accessible pull request and its current checks
Includes review and merge observations, with optional checks and review threads. Observations do not establish canonical CodeRabbit review completion. A head change during a read or thread continuation returns 409 head_changed.
GET
/
v1
/
repositories
/
{repository_id}
/
pull-requests
/
{pull_request_number}
Read an accessible pull request and its current checks
curl --request GET \
--url https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests/{pull_request_number} \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/repositories/{repository_id}/pull-requests/{pull_request_number}"
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/{pull_request_number}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"pull_request": {
"id": "<string>",
"number": 1,
"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>",
"description": "<string>"
},
"reviews": {
"decision": "<string>",
"items": [
{
"author": {
"login": "<string>"
},
"state": "<string>",
"commit_sha": "<string>"
}
],
"complete": true,
"coderabbit": {
"status": "in_progress_observed",
"reviewed_sha": "<string>",
"source_url": "<string>"
}
},
"merge": {
"mergeable": "mergeable",
"provider_state": "<string>",
"queue_entry": "<string>",
"queue_known": true,
"requirements_known": true,
"applicable": true
},
"blockers": [
{
"kind": "<string>",
"source": "<string>"
}
],
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"head_sha": "<string>",
"fetched_at": "<string>",
"head_changed": true,
"expected_head_sha": "<string>",
"checks": {
"items": [
{
"id": "<string>",
"name": "<string>",
"status": "<string>",
"conclusion": "<string>",
"details_url": "<string>",
"commit_sha": "<string>",
"required": true
}
],
"complete": true,
"requiredness_known": true
},
"threads": {
"returned": 1,
"coverage": {
"complete": true,
"limitations": [
"<string>"
]
},
"head_sha": "<string>",
"fetched_at": "<string>",
"head_changed": true,
"data": [
{
"id": "<string>",
"path": "<string>",
"line": 123,
"start_line": 123,
"original_line": 123,
"original_start_line": 123,
"side": "<string>",
"resolved": true,
"outdated": true,
"root": {
"id": "<string>",
"author": {
"login": "<string>"
},
"body": "<string>",
"url": "<string>",
"created_at": "<string>",
"commit_sha": "<string>",
"original_commit_sha": "<string>"
},
"replies": [
{
"id": "<string>",
"author": {
"login": "<string>"
},
"body": "<string>",
"url": "<string>",
"created_at": "<string>",
"commit_sha": "<string>",
"original_commit_sha": "<string>"
}
],
"replies_complete": true,
"reply_count": 1
}
],
"next_cursor": "<string>",
"applied_filters": {
"limit": 50,
"author": "coderabbit",
"state": "unresolved",
"include_outdated": false,
"include_replies": true
}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unauthenticated",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "forbidden",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "not_found",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "head_changed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "precondition_failed",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "payload_too_large",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "internal_error",
"message": "<string>",
"retry_after": 1
}
}{
"error": {
"code": "unavailable",
"message": "<string>",
"retry_after": 1
}
}- CLI Tool
- MCP Server
coderabbit api request "/repositories/$REPOSITORY_ID/pull-requests/$PULL_REQUEST_NUMBER"
This operation isn’t a tool on the CodeRabbit MCP server. Call it over REST or from the CLI.
Authorizations
See Authentication for the key types and where to create a key.
Path Parameters
Query Parameters
Organization for a workspace key: the Git-provider organization ID (scope.provider_organization_id) or the CodeRabbit organization ID (scope.id, or id from list organizations). Supply either org_id or org_name, never both. Omit for organization keys and MCP connections.
Minimum string length:
1Response
OK
Was this page helpful?