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

# Delete a learning

> Idempotently deletes a canonical learning from PostgreSQL, the LanceDB knowledge index, and patterned-learning caches. Enterprise plan and learning:write permission required.

> [tab] CLI Tool
>
> ```bash
> coderabbit api request -X DELETE "/learnings/$LEARNING_ID"
> ```
>
> 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 delete /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}:
    delete:
      tags:
        - Knowledge Base
      summary: Delete a learning
      description: >-
        Idempotently deletes a canonical learning from PostgreSQL, the LanceDB
        knowledge index, and patterned-learning caches. Enterprise plan and
        learning:write permission required.
      operationId: learnings-delete
      parameters:
        - in: path
          name: learning_id
          required: true
          schema:
            type: string
          description: Learning ID returned by GET /v1/learnings.
        - $ref: '#/components/parameters/WorkspaceOrgName'
        - in: query
          name: org_id
          required: false
          schema:
            type: string
          description: >-
            For workspace API keys, supply this git-provider organization ID or
            org_name, never both. This org_id parameter is ignored for
            organization keys.
      responses:
        '204':
          description: Learning deleted or already absent.
        '400':
          description: Invalid learning ID 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: The selected organization is not in the workspace.
        '410':
          description: Legacy organization keys cannot delete learnings.
        '429':
          description: Rate limit exceeded.
        '500':
          description: PostgreSQL, LanceDB, or internal service deletion failed.
      security:
        - ApiKeyAuth: []
components:
  parameters:
    WorkspaceOrgName:
      in: query
      name: org_name
      required: false
      schema:
        $ref: '#/components/schemas/PlatformOrgName'
      description: >-
        GitHub organization login for a workspace API key, matched
        case-insensitively within that workspace. Supply either org_name or
        org_id, never both; omit for an organization-bound key.
  schemas:
    PlatformOrgName:
      type: string
      pattern: ^[A-Za-z0-9][A-Za-z0-9-]{0,38}$
  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.