Read existing autofix status for a task or pull request
curl --request GET \
--url https://api.coderabbit.ai/v1/code/autofix \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/code/autofix"
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/code/autofix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"available": true,
"watch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"host": "github.com",
"repoId": "<string>",
"owner": "<string>",
"repo": "<string>",
"taskId": "<string>",
"prNumber": 1,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 1,
"revision": 1,
"pendingRevision": 1,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 1,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 1,
"baseBranch": "<string>",
"repairScope": "all",
"pendingEventAt": "2023-11-07T05:31:56Z",
"processedRevision": 0,
"nativeActionIds": [],
"mergeQueueEviction": {
"headSha": "<string>",
"reason": "CI_FAILURE"
},
"operationHeadSha": "<string>",
"operationContinuationTurnId": "<string>",
"operationPrompt": "<string>",
"operationActionContext": {
"details": {
"checks": [
{
"name": "<string>",
"id": "<string>",
"url": "<string>",
"summary": "<string>"
}
],
"logs": [
{
"name": "<string>",
"body": "<string>"
}
],
"comments": [
{
"body": "<string>",
"id": "<string>",
"authorKind": "human",
"author": "<string>",
"url": "<string>",
"path": "<string>",
"line": 1,
"originalLine": 1,
"originalCommitSha": "<string>",
"outdated": true
}
],
"warnings": [
"<string>"
]
},
"kind": "fix_ci",
"origin": "autopilot",
"trigger": "merge_queue_eviction",
"pullRequest": {
"url": "<string>",
"headSha": "<string>",
"title": "<string>",
"headBranch": "<string>",
"baseBranch": "<string>"
}
},
"operationMergeConflictResolution": {
"pullRequestNumber": 1,
"headBranch": "<string>",
"baseBranch": "<string>",
"baseCloneUrl": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"expectedHeadSha": "<unknown>",
"baseSha": "<unknown>",
"baseRefreshUsed": true
},
"operationFindings": [],
"findingDispositions": [],
"operationBilling": {
"access": "metered",
"chargebeeSubscriptionId": "<string>",
"factoryLoop": {
"loopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingMilliseconds": 1,
"startupProtocol": "occurrence_v1"
},
"codingPaidUsageAllowedAtAdmission": true,
"codingSpendCapPolicy": "admission_v1",
"prepaidAuthorizationRequired": true,
"prepaidUsageMetric": "agent_minutes",
"creditActor": {
"provider": "slack",
"userId": "<string>"
}
},
"settledOperationId": "<string>",
"review": {
"headSha": "<string>",
"complete": true,
"findings": [
{
"filePath": "<string>",
"startLine": 1,
"endLine": 1,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
},
"deliveryConflict": {
"reasonCode": "delivery_conflict",
"operationId": "<string>",
"attemptedHeadSha": "<string>",
"patchGeneration": 1
},
"ciFollowups": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"host": "github.com",
"repoId": "<string>",
"owner": "<string>",
"repo": "<string>",
"taskId": "<string>",
"prNumber": 1,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 1,
"revision": 1,
"pendingRevision": 1,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 1,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 1,
"baseBranch": "<string>",
"repairScope": "all",
"pendingEventAt": "2023-11-07T05:31:56Z",
"processedRevision": 0,
"nativeActionIds": [],
"mergeQueueEviction": {
"headSha": "<string>",
"reason": "CI_FAILURE"
},
"operationHeadSha": "<string>",
"operationContinuationTurnId": "<string>",
"operationPrompt": "<string>",
"operationActionContext": {
"details": {
"checks": [
{
"name": "<string>",
"id": "<string>",
"url": "<string>",
"summary": "<string>"
}
],
"logs": [
{
"name": "<string>",
"body": "<string>"
}
],
"comments": [
{
"body": "<string>",
"id": "<string>",
"authorKind": "human",
"author": "<string>",
"url": "<string>",
"path": "<string>",
"line": 1,
"originalLine": 1,
"originalCommitSha": "<string>",
"outdated": true
}
],
"warnings": [
"<string>"
]
},
"kind": "fix_ci",
"origin": "autopilot",
"trigger": "merge_queue_eviction",
"pullRequest": {
"url": "<string>",
"headSha": "<string>",
"title": "<string>",
"headBranch": "<string>",
"baseBranch": "<string>"
}
},
"operationMergeConflictResolution": {
"pullRequestNumber": 1,
"headBranch": "<string>",
"baseBranch": "<string>",
"baseCloneUrl": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"expectedHeadSha": "<unknown>",
"baseSha": "<unknown>",
"baseRefreshUsed": true
},
"operationFindings": [],
"findingDispositions": [],
"operationBilling": {
"access": "metered",
"chargebeeSubscriptionId": "<string>",
"factoryLoop": {
"loopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingMilliseconds": 1,
"startupProtocol": "occurrence_v1"
},
"codingPaidUsageAllowedAtAdmission": true,
"codingSpendCapPolicy": "admission_v1",
"prepaidAuthorizationRequired": true,
"prepaidUsageMetric": "agent_minutes",
"creditActor": {
"provider": "slack",
"userId": "<string>"
}
},
"settledOperationId": "<string>",
"review": {
"headSha": "<string>",
"complete": true,
"findings": [
{
"filePath": "<string>",
"startLine": 1,
"endLine": 1,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
}
}{
"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 existing autofix status for a task or pull request
Returns the autofix watch state for a coding task or pull request, and whether autofix is available. Requires coding_agent:read. available is false when the organization has no coding agent access. A pending deliveryConflict is returned for use with the recover action.
GET
/
v1
/
code
/
autofix
Read existing autofix status for a task or pull request
curl --request GET \
--url https://api.coderabbit.ai/v1/code/autofix \
--header 'x-coderabbitai-api-key: <api-key>'import requests
url = "https://api.coderabbit.ai/v1/code/autofix"
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/code/autofix', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"available": true,
"watch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"host": "github.com",
"repoId": "<string>",
"owner": "<string>",
"repo": "<string>",
"taskId": "<string>",
"prNumber": 1,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 1,
"revision": 1,
"pendingRevision": 1,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 1,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 1,
"baseBranch": "<string>",
"repairScope": "all",
"pendingEventAt": "2023-11-07T05:31:56Z",
"processedRevision": 0,
"nativeActionIds": [],
"mergeQueueEviction": {
"headSha": "<string>",
"reason": "CI_FAILURE"
},
"operationHeadSha": "<string>",
"operationContinuationTurnId": "<string>",
"operationPrompt": "<string>",
"operationActionContext": {
"details": {
"checks": [
{
"name": "<string>",
"id": "<string>",
"url": "<string>",
"summary": "<string>"
}
],
"logs": [
{
"name": "<string>",
"body": "<string>"
}
],
"comments": [
{
"body": "<string>",
"id": "<string>",
"authorKind": "human",
"author": "<string>",
"url": "<string>",
"path": "<string>",
"line": 1,
"originalLine": 1,
"originalCommitSha": "<string>",
"outdated": true
}
],
"warnings": [
"<string>"
]
},
"kind": "fix_ci",
"origin": "autopilot",
"trigger": "merge_queue_eviction",
"pullRequest": {
"url": "<string>",
"headSha": "<string>",
"title": "<string>",
"headBranch": "<string>",
"baseBranch": "<string>"
}
},
"operationMergeConflictResolution": {
"pullRequestNumber": 1,
"headBranch": "<string>",
"baseBranch": "<string>",
"baseCloneUrl": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"expectedHeadSha": "<unknown>",
"baseSha": "<unknown>",
"baseRefreshUsed": true
},
"operationFindings": [],
"findingDispositions": [],
"operationBilling": {
"access": "metered",
"chargebeeSubscriptionId": "<string>",
"factoryLoop": {
"loopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingMilliseconds": 1,
"startupProtocol": "occurrence_v1"
},
"codingPaidUsageAllowedAtAdmission": true,
"codingSpendCapPolicy": "admission_v1",
"prepaidAuthorizationRequired": true,
"prepaidUsageMetric": "agent_minutes",
"creditActor": {
"provider": "slack",
"userId": "<string>"
}
},
"settledOperationId": "<string>",
"review": {
"headSha": "<string>",
"complete": true,
"findings": [
{
"filePath": "<string>",
"startLine": 1,
"endLine": 1,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
},
"deliveryConflict": {
"reasonCode": "delivery_conflict",
"operationId": "<string>",
"attemptedHeadSha": "<string>",
"patchGeneration": 1
},
"ciFollowups": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider": "github",
"host": "github.com",
"repoId": "<string>",
"owner": "<string>",
"repo": "<string>",
"taskId": "<string>",
"prNumber": 1,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 1,
"revision": 1,
"pendingRevision": 1,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 1,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 1,
"baseBranch": "<string>",
"repairScope": "all",
"pendingEventAt": "2023-11-07T05:31:56Z",
"processedRevision": 0,
"nativeActionIds": [],
"mergeQueueEviction": {
"headSha": "<string>",
"reason": "CI_FAILURE"
},
"operationHeadSha": "<string>",
"operationContinuationTurnId": "<string>",
"operationPrompt": "<string>",
"operationActionContext": {
"details": {
"checks": [
{
"name": "<string>",
"id": "<string>",
"url": "<string>",
"summary": "<string>"
}
],
"logs": [
{
"name": "<string>",
"body": "<string>"
}
],
"comments": [
{
"body": "<string>",
"id": "<string>",
"authorKind": "human",
"author": "<string>",
"url": "<string>",
"path": "<string>",
"line": 1,
"originalLine": 1,
"originalCommitSha": "<string>",
"outdated": true
}
],
"warnings": [
"<string>"
]
},
"kind": "fix_ci",
"origin": "autopilot",
"trigger": "merge_queue_eviction",
"pullRequest": {
"url": "<string>",
"headSha": "<string>",
"title": "<string>",
"headBranch": "<string>",
"baseBranch": "<string>"
}
},
"operationMergeConflictResolution": {
"pullRequestNumber": 1,
"headBranch": "<string>",
"baseBranch": "<string>",
"baseCloneUrl": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"expectedHeadSha": "<unknown>",
"baseSha": "<unknown>",
"baseRefreshUsed": true
},
"operationFindings": [],
"findingDispositions": [],
"operationBilling": {
"access": "metered",
"chargebeeSubscriptionId": "<string>",
"factoryLoop": {
"loopId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"remainingMilliseconds": 1,
"startupProtocol": "occurrence_v1"
},
"codingPaidUsageAllowedAtAdmission": true,
"codingSpendCapPolicy": "admission_v1",
"prepaidAuthorizationRequired": true,
"prepaidUsageMetric": "agent_minutes",
"creditActor": {
"provider": "slack",
"userId": "<string>"
}
},
"settledOperationId": "<string>",
"review": {
"headSha": "<string>",
"complete": true,
"findings": [
{
"filePath": "<string>",
"startLine": 1,
"endLine": 1,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
}
}{
"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 "/code/autofix?target[type]=task&target[taskId]=$TARGET_TASK_ID"
An agent connected to the CodeRabbit MCP server runs this operation as the
get_code_autofix tool. The connection selects the organization, so the arguments have no org_id or org_name.{
"method": "tools/call",
"params": {
"name": "get_code_autofix",
"arguments": {
"target": "<target>"
}
}
}
Authorizations
See Authentication for the key types and where to create a key.
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:
1Was this page helpful?