> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a 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.

> [tab] CLI Tool
>
> ```bash
> coderabbit api request -X PATCH "/learnings/$LEARNING_ID" --input request.json
> ```
>
> To install and sign in to the CLI, see [Call from the CLI](https://docs.coderabbit.ai/api/cli.md).

> [tab] MCP Server
>
> This operation isn't a tool on the [CodeRabbit MCP server](https://docs.coderabbit.ai/api/mcp.md). Call it over REST or from the CLI.


## OpenAPI

````yaml /openapi.json patch /v1/learnings/{learning_id}
openapi: 3.0.0
info:
  title: CodeRabbit API
  version: 1.0.0
  description: >-
    Read and manage CodeRabbit reviews, coding tasks, Verify, Triage, security
    findings, Knowledge Base, configuration, and users for your organization.
servers:
  - url: https://api.coderabbit.ai
    description: US region
  - url: https://api.eu.coderabbit.ai
    description: EU region
security:
  - ApiKeyAuth: []
tags:
  - name: Organizations and repositories
  - name: Pull requests and reviews
  - name: Coding Agent
  - name: Coding environments
  - name: Verify
  - name: Triage
  - name: Security
  - name: Knowledge Base
  - name: Automations
  - name: Reports
  - name: Configuration
  - name: Connections
  - name: Users and roles
  - name: Usage and metrics
paths:
  /v1/learnings/{learning_id}:
    patch:
      tags:
        - Knowledge Base
      summary: Update a learning
      description: >-
        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.
      operationId: learnings-update
      parameters:
        - in: path
          name: learning_id
          required: true
          schema:
            type: string
          description: Learning ID returned by GET /v1/learnings.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - learning
              additionalProperties: false
              properties:
                org_name:
                  type: string
                  pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}$
                  description: >-
                    GitHub organization login for a workspace API key, matched
                    case-insensitively. Supply either org_name or org_id, never
                    both; omit for an organization-bound key.
                org_id:
                  type: string
                  description: >-
                    For workspace API keys, supply this git-provider
                    organization ID or org_name, never both. Ignored for
                    organization keys.
                learning:
                  type: string
                  minLength: 1
      responses:
        '204':
          description: Learning updated and, when shared, reindexed.
        '400':
          description: >-
            Invalid learning ID, text, request body, or missing workspace
            organization selector.
        '401':
          description: Invalid key or missing authenticated identity.
        '403':
          description: >-
            Enterprise plan or learning:write permission required; agentic keys
            are forbidden.
        '404':
          description: >-
            Learning not found in the target organization, or the organization
            is not in the workspace.
        '410':
          description: Legacy organization keys cannot update learnings.
        '429':
          description: Rate limit exceeded.
        '500':
          description: PostgreSQL, LanceDB, or internal service update failed.
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-coderabbitai-api-key
      description: >-
        See [Authentication](/api/authentication) for the key types and where to
        create a key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.