Update a learning
curl --request PATCH \
--url https://api.coderabbit.ai/v1/learnings/{learning_id} \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"learning": "<string>",
"org_id": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/learnings/{learning_id}"
payload = {
"learning": "<string>",
"org_id": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({learning: '<string>', org_id: '<string>'})
};
fetch('https://api.coderabbit.ai/v1/learnings/{learning_id}', 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/learnings/{learning_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'learning' => '<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/learnings/{learning_id}"
payload := strings.NewReader("{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.coderabbit.ai/v1/learnings/{learning_id}")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/learnings/{learning_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdate Learning
Replaces canonical learning text and refreshes its LanceDB embedding. The text is trimmed and recognized credentials are redacted before persistence and indexing. Enterprise plan and learning:write permission required.
PATCH
/
v1
/
learnings
/
{learning_id}
Update a learning
curl --request PATCH \
--url https://api.coderabbit.ai/v1/learnings/{learning_id} \
--header 'Content-Type: application/json' \
--header 'x-coderabbitai-api-key: <api-key>' \
--data '
{
"learning": "<string>",
"org_id": "<string>"
}
'import requests
url = "https://api.coderabbit.ai/v1/learnings/{learning_id}"
payload = {
"learning": "<string>",
"org_id": "<string>"
}
headers = {
"x-coderabbitai-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-coderabbitai-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({learning: '<string>', org_id: '<string>'})
};
fetch('https://api.coderabbit.ai/v1/learnings/{learning_id}', 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/learnings/{learning_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'learning' => '<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/learnings/{learning_id}"
payload := strings.NewReader("{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.coderabbit.ai/v1/learnings/{learning_id}")
.header("x-coderabbitai-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coderabbit.ai/v1/learnings/{learning_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-coderabbitai-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"learning\": \"<string>\",\n \"org_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyUpdate Learning
Requires the
learning:write permission. Workspace API key owners must also remain workspace admins.API key eligibility
User and workspace API keys can update Learnings. Legacy organization API keys and agentic API keys cannot use this endpoint. A workspace API key must select one organization for every request by providing that organizationās Git provider ID asorg_id.
Update behavior
An update replaces the canonical Learning text after trimming whitespace and redacting recognized credentials. CodeRabbit then rebuilds the shared review-index record and its embedding from the canonical Learning metadata. If the canonical update succeeds but the index refresh fails, repeat the same request. The retry rebuilds the derived index from the canonical record.Rate limit
The Learnings write endpoints share a limit of 10 requests per minute per organization.Authorizations
API key for authentication. You can create an API key from the CodeRabbit dashboard.
Path Parameters
Learning ID returned by GET or POST /v1/learnings.
Body
application/json
Response
Learning updated and, when shared, reindexed.
Was this page helpful?