---
title: "Update a learning"
method: PATCH
path: "/v1/learnings/{learning_id}"
tags: ["Learnings"]
---

# Update a learning

`PATCH /v1/learnings/{learning_id}`

## Request

- Base URL: `https://api.coderabbit.ai`
- URL: `https://api.coderabbit.ai/v1/learnings/{learning_id}`
- Auth: API key in header `x-coderabbitai-api-key`

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.

## Path parameters

- `learning_id` string, required

## Request body

- object
  - `org_id` string: Required for workspace API keys; the git-provider organization ID to target. Ignored for organization keys.
  - `learning` string, required

## Response `204`

Learning updated and, when shared, reindexed.

## Other responses

- `400`: Invalid learning ID, text, request body, or missing workspace org_id.
- `401`: Invalid key or missing authenticated identity.
- `403`: Enterprise plan or learning:write permission required; agentic keys are forbidden.
- `404`: Learning not found in the target organization, or the organization is not in the workspace.
- `410`: Legacy organization keys cannot update learnings.
- `429`: Rate limit exceeded.
- `500`: PostgreSQL, LanceDB, or internal service update failed.

## Changes

- **2026-08-31** `342932e3f001`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/changes/v1/learnings/:learning_id/patch.md)

---

[API](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec.md) - [All operations](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/llms.txt) - [OpenAPI document](https://skmtc.dev/coderabbit/apis/coderabbit-api-spec/revisions/a9e20f8748a9?raw)
