Enable, disable, resume or recover existing autofix
curl --request POST \
--url https://api.coderabbit.ai/v1/code/autofix/commands \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"target": {
"type": "task",
"taskId": "<string>"
},
"sourceEventId": "<string>",
"org_id": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/code/autofix/commands"
payload = {
"target": {
"type": "task",
"taskId": "<string>"
},
"sourceEventId": "<string>",
"org_id": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'task', taskId: '<string>'},
sourceEventId: '<string>',
org_id: '<string>'
})
};
fetch('https://api.coderabbit.ai/v1/code/autofix/commands', 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/code/autofix/commands",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => [
'type' => 'task',
'taskId' => '<string>'
],
'sourceEventId' => '<string>',
'org_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/code/autofix/commands"
payload := strings.NewReader("{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coderabbit.ai/v1/code/autofix/commands")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/code/autofix/commands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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": 4503599627370495,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 4503599627370495,
"revision": 4503599627370495,
"pendingRevision": 4503599627370495,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 4503599627370495,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 4503599627370495,
"baseBranch": "<string>",
"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": 4503599627370495,
"originalLine": 4503599627370495,
"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": 4503599627370495,
"headBranch": "<string>",
"baseBranch": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"baseCloneUrl": "<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": 4503599627370495,
"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": 4503599627370495,
"endLine": 4503599627370495,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
},
"deliveryConflict": {
"reasonCode": "delivery_conflict",
"operationId": "<string>",
"attemptedHeadSha": "<string>",
"patchGeneration": 4503599627370495
}
}{
"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
}
}Enable, disable, resume or recover existing autofix
POST
/
v1
/
code
/
autofix
/
commands
Enable, disable, resume or recover existing autofix
curl --request POST \
--url https://api.coderabbit.ai/v1/code/autofix/commands \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"target": {
"type": "task",
"taskId": "<string>"
},
"sourceEventId": "<string>",
"org_id": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/code/autofix/commands"
payload = {
"target": {
"type": "task",
"taskId": "<string>"
},
"sourceEventId": "<string>",
"org_id": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {type: 'task', taskId: '<string>'},
sourceEventId: '<string>',
org_id: '<string>'
})
};
fetch('https://api.coderabbit.ai/v1/code/autofix/commands', 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/code/autofix/commands",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'target' => [
'type' => 'task',
'taskId' => '<string>'
],
'sourceEventId' => '<string>',
'org_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coderabbit.ai/v1/code/autofix/commands"
payload := strings.NewReader("{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-coderabbitai-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coderabbit.ai/v1/code/autofix/commands")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/code/autofix/commands")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target\": {\n \"type\": \"task\",\n \"taskId\": \"<string>\"\n },\n \"sourceEventId\": \"<string>\",\n \"org_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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": 4503599627370495,
"prUrl": "<string>",
"sourceRepositoryId": "<string>",
"sourceBranch": "<string>",
"requestedBy": {
"id": "<string>",
"login": "<string>"
},
"providerUserId": "<string>",
"enabled": true,
"generation": 4503599627370495,
"revision": 4503599627370495,
"pendingRevision": 4503599627370495,
"state": "waiting_for_pr",
"rounds": 2,
"unchangedRounds": 4503599627370495,
"headSha": "<string>",
"remainingFingerprint": "<string>",
"operationId": "<string>",
"workflowId": "<string>",
"reason": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"summaryCommentId": 4503599627370495,
"baseBranch": "<string>",
"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": 4503599627370495,
"originalLine": 4503599627370495,
"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": 4503599627370495,
"headBranch": "<string>",
"baseBranch": "<string>",
"conflictingFiles": [
{
"path": "<string>",
"conflictType": "<string>"
}
],
"baseRepositoryId": "<string>",
"baseCloneUrl": "<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": 4503599627370495,
"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": 4503599627370495,
"endLine": 4503599627370495,
"codegenInstructions": "<string>",
"commentIdentity": "<string>",
"isNitpick": true,
"isOutsideDiff": true
}
],
"botUserId": "<string>",
"blockingPreMergeChecks": []
},
"reviewHistory": [],
"cursor": "<string>"
},
"deliveryConflict": {
"reasonCode": "delivery_conflict",
"operationId": "<string>",
"attemptedHeadSha": "<string>",
"patchGeneration": 4503599627370495
}
}{
"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.
Body
application/json
Was this page helpful?