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



## OpenAPI

````yaml /openapi.json patch /v1/learnings/{learning_id}
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/learnings/{learning_id}:
    patch:
      tags:
        - Learnings
      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_id:
                  type: string
                  description: >-
                    Required for workspace API keys; the git-provider
                    organization ID to target. 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
            org_id.
        '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: >-
        API key for authentication. You can create an API key from the
        CodeRabbit dashboard.

````

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