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

# Get Knowledge Base

> Returns a single knowledge base by ID.
Requires `knowledge:view` permission.




## OpenAPI

````yaml GET /api/knowledge-bases/{id}
openapi: 3.1.0
info:
  title: Naturalead Knowledge Bases API
  version: 1.0.0
  description: >
    API for managing knowledge bases, documents, sitemap crawl jobs, and webhook

    sources in the Naturalead platform. All endpoints require API key
    authentication

    and are scoped to the caller's account.
servers:
  - url: '{baseUrl}'
    description: API server
    variables:
      baseUrl:
        default: http://localhost:3001
security:
  - BearerAuth: []
tags:
  - name: Knowledge Bases
    description: Knowledge base CRUD operations
  - name: Documents
    description: Document management within a knowledge base
  - name: Sitemap & Crawl Jobs
    description: Sitemap scanning and web crawl job management
  - name: Webhook Sources
    description: Webhook source management for auto-updating content
paths:
  /api/knowledge-bases/{id}:
    get:
      tags:
        - Knowledge Bases
      summary: Get knowledge base
      description: |
        Returns a single knowledge base by ID.
        Requires `knowledge:view` permission.
      operationId: getKnowledgeBase
      parameters:
        - $ref: '#/components/parameters/KnowledgeBaseId'
      responses:
        '200':
          description: Knowledge base details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBase'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    KnowledgeBaseId:
      name: id
      in: path
      required: true
      description: Knowledge base ID
      schema:
        type: string
  schemas:
    KnowledgeBase:
      type: object
      properties:
        _id:
          type: string
          description: Unique identifier
        accountId:
          type: string
          description: Owning account ID
        name:
          type: string
          description: Knowledge base name
        description:
          type: string
          description: Knowledge base description
        type:
          type: string
          enum:
            - internal
            - external
          description: Knowledge base type
        documentCount:
          type: integer
          description: Number of documents in the knowledge base
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - _id
        - accountId
        - name
        - type
        - documentCount
        - createdAt
        - updatedAt
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
            required:
              - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token using an API key (format nl_live_* or nl_test_*)

````