Set a change's manual priority
curl --request PUT \
--url https://api.coderabbit.ai/v1/triage/changes/{id}/priority \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"expected_revision": "<string>",
"idempotency_key": "<string>",
"org_id": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/triage/changes/{id}/priority"
payload = {
"expected_revision": "<string>",
"idempotency_key": "<string>",
"org_id": "<string>",
"reason": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_revision: '<string>',
idempotency_key: '<string>',
org_id: '<string>',
reason: '<string>'
})
};
fetch('https://api.coderabbit.ai/v1/triage/changes/{id}/priority', 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/triage/changes/{id}/priority",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision' => '<string>',
'idempotency_key' => '<string>',
'org_id' => '<string>',
'reason' => '<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/triage/changes/{id}/priority"
payload := strings.NewReader("{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.coderabbit.ai/v1/triage/changes/{id}/priority")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/triage/changes/{id}/priority")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "updated",
"current": {
"urgency": "p0",
"score": 50,
"actor": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>"
},
"changed_at": "2023-11-07T05:31:56Z"
}
}{
"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
}
}Set a change's manual priority
Applies p0–p3 using existing seated-user and repository authorization. Read priority.revision from change detail first. Reuse the same idempotency_key and expected_revision for an uncertain retry; duplicate commands return the latest current state. A new command against stale priority returns conflict. This does not close a pull request or clear an override.
PUT
/
v1
/
triage
/
changes
/
{id}
/
priority
Set a change's manual priority
curl --request PUT \
--url https://api.coderabbit.ai/v1/triage/changes/{id}/priority \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"expected_revision": "<string>",
"idempotency_key": "<string>",
"org_id": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/triage/changes/{id}/priority"
payload = {
"expected_revision": "<string>",
"idempotency_key": "<string>",
"org_id": "<string>",
"reason": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_revision: '<string>',
idempotency_key: '<string>',
org_id: '<string>',
reason: '<string>'
})
};
fetch('https://api.coderabbit.ai/v1/triage/changes/{id}/priority', 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/triage/changes/{id}/priority",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'expected_revision' => '<string>',
'idempotency_key' => '<string>',
'org_id' => '<string>',
'reason' => '<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/triage/changes/{id}/priority"
payload := strings.NewReader("{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.coderabbit.ai/v1/triage/changes/{id}/priority")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/triage/changes/{id}/priority")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"expected_revision\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"org_id\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "updated",
"current": {
"urgency": "p0",
"score": 50,
"actor": {
"id": "<string>",
"name": "<string>",
"avatar_url": "<string>"
},
"changed_at": "2023-11-07T05:31:56Z"
}
}{
"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
}
}This operation starts with internal qualification and must be enabled for your organization. Triage eligibility, an active review seat and current repository access are required.
Read before writing
ReadGET /v1/triage/changes/{id} and use data.priority.revision as expected_revision. This opaque value is a concurrency precondition, not a credential or the displayed score. A null or absent revision means the precondition is unavailable; reread instead of constructing one. List responses do not supply this detail-only field.
coderabbit api --api-key-file /path/to/api-key request \
/triage/changes/CHANGE_ID > change.json
jq -e '.data.priority.revision != null' change.json && \
jq --arg key "$(uuidgen)" \
'{urgency: "p1", reason: "Blocks the release", expected_revision: .data.priority.revision, idempotency_key: $key}' \
change.json > priority-request.json
jq command fails. Use the change’s returned UUID, not its provider PR number. Generate this file once per new decision; for retries, reuse it without rerunning these commands.
coderabbit api --api-key-file /path/to/api-key request \
/triage/changes/CHANGE_ID/priority \
--method PUT --input priority-request.json
Retry an uncertain result
Retry the exact same body with the originalexpected_revision and idempotency_key. Duplicate detection precedes stale-state checks. A duplicate response returns the latest current state, which may reflect another user’s later decision; it does not reapply your change. That current state can include close_candidate, although this endpoint cannot set it.
A new command with a stale precondition conflicts with the current state. Reread before making a new decision, using a new command key. Obtain revisions from the selected change and organization; a valid revision never bypasses permission checks.
Hosted MCP exposes set_triage_change_priority with account:read, triage:read and triage:write consent. For workspace keys, send the organization selector org_id in the query on the detail read and in the JSON body on this update. Organization-scoped keys omit it.Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Path Parameters
Body
application/json
Available options:
p0, p1, p2, p3 Use priority.revision from the current change detail. Retain this value and idempotency_key when retrying the same command.
Required string length:
1 - 2048Unique command identity. A repeated key returns the native current state without applying another change.
Required string length:
1 - 255Maximum string length:
200Was this page helpful?