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

# List learnings for an organization

> Programmatic access to an organization's CodeRabbit learnings. Returns paginated JSON or a CSV download. Enterprise plan only. Mirrors the auth, rate-limit and response-size contract of the Metrics public API.

> [tab] CLI Tool
>
> ```bash
> coderabbit api request /learnings
> ```
>
> 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.

A CSV response is a single page of up to `limit` rows, with no cursor, so use JSON when you expect more rows than `limit`. See [List and export organization Learnings](https://docs.coderabbit.ai/api/guides/learnings.md#list-and-export-organization-learnings).


## OpenAPI

````yaml /openapi.json get /v1/learnings
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:
    get:
      tags:
        - Knowledge Base
      summary: List learnings for an organization
      description: >-
        Programmatic access to an organization's CodeRabbit learnings. Returns
        paginated JSON or a CSV download. Enterprise plan only. Mirrors the
        auth, rate-limit and response-size contract of the Metrics public API.
      operationId: learnings-list
      parameters:
        - $ref: '#/components/parameters/WorkspaceOrgName'
        - in: query
          name: org_id
          required: false
          schema:
            type: string
          description: >-
            Workspace-scoped API tokens only. Supply this git-provider
            organization ID or org_name, never both, to scope learnings to one
            organization. When both selectors are omitted, aggregates every
            organization in the workspace. This org_id parameter is ignored for
            organization and self-hosted keys.
        - in: query
          name: repository_ids
          schema:
            type: string
            example: 1027529638,987654321
          description: Comma-separated provider repository IDs (max 10).
        - in: query
          name: user_ids
          schema:
            type: string
            example: 87397876,12345678
          description: Comma-separated provider user IDs (max 10).
        - in: query
          name: search
          schema:
            type: string
          description: Case-insensitive substring search over learning text.
        - in: query
          name: file_paths
          schema:
            type: string
            example: src/api.ts,src/auth.ts
          description: Comma-separated exact file paths (max 10).
        - in: query
          name: stat_filter
          schema:
            type: string
            enum:
              - total
              - active
              - never_used
              - created_this_week
            default: total
          description: >-
            Filter by recent usage, zero usage, or creation in the last seven
            days.
        - in: query
          name: organization_ids
          schema:
            type: string
            example: 184456712,103539130
          description: >-
            Comma-separated provider organization IDs (max 10). Self-hosted
            instances only.
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 1000
          description: Maximum number of records to return.
        - in: query
          name: cursor
          schema:
            type: string
          description: Pagination cursor returned as `next_cursor` on the previous page.
        - in: query
          name: format
          schema:
            type: string
            enum:
              - json
              - csv
            default: json
          description: >-
            Response format. `json` (default) returns paginated JSON; `csv`
            returns a CSV download.
      responses:
        '200':
          description: Successfully retrieved learnings.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - next_cursor
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - learning
                        - repository_name
                        - author_username
                        - created_at
                        - updated_at
                        - usage_count
                      properties:
                        id:
                          type: string
                          description: Unique identifier for the learning.
                        learning:
                          type: string
                        organization_id:
                          type: string
                          nullable: true
                          description: Git provider organization ID.
                        organization_name:
                          type: string
                          nullable: true
                        repository_id:
                          type: string
                          nullable: true
                          description: Git provider repository ID.
                        repository_name:
                          type: string
                        author_id:
                          type: string
                          nullable: true
                          description: Git provider user ID of the learning author.
                        author_username:
                          type: string
                        file:
                          type: string
                          nullable: true
                        source_url:
                          type: string
                          nullable: true
                          description: >-
                            URL of the PR comment where the learning was
                            captured.
                        pull_request:
                          type: integer
                          nullable: true
                          description: Source pull request or merge request number.
                        created_at:
                          type: string
                          format: date-time
                        updated_at:
                          type: string
                          format: date-time
                        usage_count:
                          type: integer
                        last_used_at:
                          type: string
                          format: date-time
                          nullable: true
                  next_cursor:
                    type: string
                    nullable: true
            text/csv:
              schema:
                type: string
                format: binary
                description: CSV file download.
        '400':
          description: Bad request — invalid parameters or cursor.
        '401':
          description: Unauthorized — invalid or inactive API key.
        '403':
          description: Forbidden — Enterprise plan required or agentic key not allowed.
        '404':
          description: >-
            Not found — self-hosted instance has no organizations matching the
            supplied `organization_ids`. Returned only for self-hosted callers
            when scope resolution narrows to an empty set.
        '413':
          description: Response exceeds 16 MB. Add filters or reduce `limit`.
        '429':
          description: Rate limit exceeded.
        '500':
          description: Internal server error.
      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.