Create a coding task
curl --request POST \
--url https://api.coderabbit.ai/v1/code/tasks \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"repository_id": "<string>",
"branch": "<string>",
"instructions": "<string>",
"client_request_id": "<string>",
"org_id": "<string>",
"is_private": true
}
'import requests
url = "https://api.coderabbit.ai/v1/code/tasks"
payload = {
"repository_id": "<string>",
"branch": "<string>",
"instructions": "<string>",
"client_request_id": "<string>",
"org_id": "<string>",
"is_private": True
}
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({
repository_id: '<string>',
branch: '<string>',
instructions: '<string>',
client_request_id: '<string>',
org_id: '<string>',
is_private: true
})
};
fetch('https://api.coderabbit.ai/v1/code/tasks', 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/tasks",
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([
'repository_id' => '<string>',
'branch' => '<string>',
'instructions' => '<string>',
'client_request_id' => '<string>',
'org_id' => '<string>',
'is_private' => true
]),
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/tasks"
payload := strings.NewReader("{\n \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\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/tasks")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/code/tasks")
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 \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\n}"
response = http.request(request)
puts response.read_body{
"task": {
"task_id": "<string>",
"title": "<string>",
"status": "<string>",
"turn_status": "<string>",
"repository_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"pull_request_url": "<string>",
"plan_version": 4503599627370495
},
"created": true
}{
"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
}
}Create a coding task
Uses the existing coding task admission, permissions, billing and product flags. Delivery initially produces a proposed patch.
POST
/
v1
/
code
/
tasks
Create a coding task
curl --request POST \
--url https://api.coderabbit.ai/v1/code/tasks \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"repository_id": "<string>",
"branch": "<string>",
"instructions": "<string>",
"client_request_id": "<string>",
"org_id": "<string>",
"is_private": true
}
'import requests
url = "https://api.coderabbit.ai/v1/code/tasks"
payload = {
"repository_id": "<string>",
"branch": "<string>",
"instructions": "<string>",
"client_request_id": "<string>",
"org_id": "<string>",
"is_private": True
}
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({
repository_id: '<string>',
branch: '<string>',
instructions: '<string>',
client_request_id: '<string>',
org_id: '<string>',
is_private: true
})
};
fetch('https://api.coderabbit.ai/v1/code/tasks', 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/tasks",
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([
'repository_id' => '<string>',
'branch' => '<string>',
'instructions' => '<string>',
'client_request_id' => '<string>',
'org_id' => '<string>',
'is_private' => true
]),
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/tasks"
payload := strings.NewReader("{\n \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\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/tasks")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/code/tasks")
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 \"repository_id\": \"<string>\",\n \"branch\": \"<string>\",\n \"instructions\": \"<string>\",\n \"client_request_id\": \"<string>\",\n \"org_id\": \"<string>\",\n \"is_private\": true\n}"
response = http.request(request)
puts response.read_body{
"task": {
"task_id": "<string>",
"title": "<string>",
"status": "<string>",
"turn_status": "<string>",
"repository_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"pull_request_url": "<string>",
"plan_version": 4503599627370495
},
"created": true
}{
"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
Minimum string length:
1Required string length:
1 - 1024Required string length:
1 - 65536Required string length:
1 - 200Minimum string length:
1Available options:
code, plan Was this page helpful?