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

# Get Knowledge Base

> Get knowledge base details by ID

Retrieve detailed information about a specific knowledge base including its configuration, document count, and metadata.

## Path Parameters

<ParamField path="kb_id" type="string" required>
  Unique identifier of the knowledge base (UUID format)
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier for the knowledge base (UUID)
</ResponseField>

<ResponseField name="name" type="string">
  Display name of the knowledge base
</ResponseField>

<ResponseField name="description" type="string">
  Optional description of the knowledge base purpose (can be null)
</ResponseField>

<ResponseField name="type" type="string">
  Knowledge base type: `managed`
</ResponseField>

<ResponseField name="organization_id" type="string">
  UUID of the organization that owns this knowledge base
</ResponseField>

<ResponseField name="agent_id" type="string">
  UUID of the agent this knowledge base is attached to (can be null)
</ResponseField>

<ResponseField name="total_documents" type="integer">
  Total number of documents in the knowledge base
</ResponseField>

## Example Request

```bash theme={"dark"}
curl -X GET -H "x-api-key: <your-api-key>" \
  https://api.xpander.ai/v1/knowledge/<kb-id>
```

## Example Response

```json theme={"dark"}
{
  "id": "73dc30ca-bdbf-42f7-a39f-93aff4f8522e",
  "name": "Product Catalog",
  "description": "Complete product information and specifications",
  "type": "managed",
  "organization_id": "<org-id>",
  "agent_id": null,
  "total_documents": 12
}
```

## Notes

* Returns 404 if the knowledge base is not found or doesn't belong to your organization
* Use this endpoint to verify knowledge base existence before adding documents


## OpenAPI

````yaml GET /v1/knowledge/{kb_id}
openapi: 3.1.0
info:
  title: xpander.ai API Service
  description: |2-

        The xpander.ai API Service provides a unified REST API for managing AI agents,
        executing tasks, managing knowledge bases, and integrating with external systems.
        
        Features:
        - Agent Management: Create, update, deploy, and delete AI agents
        - Task Execution: Invoke agents with support for sync, async, and streaming modes
        - Knowledge Bases: Manage knowledge bases and documents for RAG workflows
        - Tools: Discover, connect, and attach tools (connectors, custom functions, MCP servers, sub-agents, workflows) to agents and workflows
        - MCP Integration: Model Context Protocol support for standardized AI interactions
        
        Authentication: All endpoints require authentication via either an API key (`x-api-key`) or an OAuth2 JWT (`Authorization: Bearer <jwt>`).
        
  version: '0.001'
servers:
  - url: https://api.xpander.ai
security: []
paths:
  /v1/knowledge/{kb_id}:
    get:
      tags:
        - API v1
        - Knowledge
        - Knowledge CRUD
      summary: Get Knowledge Base Details
      description: Get knowledge base item details by id
      operationId: Get_knowledge_base_details_v1_knowledge__kb_id__get
      parameters:
        - name: kb_id
          in: path
          required: true
          schema:
            type: string
            title: Kb Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    KnowledgeBaseItem:
      properties:
        id:
          type: string
          title: Id
          description: KB unique identifier
        name:
          type: string
          title: Name
          description: KB name specified by the user
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: KB description specified by the user
        type:
          $ref: '#/components/schemas/KnowledgeBaseType'
          description: KB type, managed / external
        organization_id:
          type: string
          title: Organization Id
          description: Organization ID
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: Agent ID
        total_documents:
          type: integer
          title: Total Documents
          description: Total count of embedded documents
          default: 0
      type: object
      required:
        - id
        - name
        - type
        - organization_id
      title: KnowledgeBaseItem
      description: |-
        Represents a Knowledge Base item.

        Attributes:
            id (str): KB unique identifier.
            name (str): KB name specified by the user.
            description (str): KB description specified by the user.
            type (KnowledgeBaseType): KB type, either managed or external.
            organization_id (str): Organization ID associated with the KB.
            total_documents (int): Total count of embedded documents. Defaults to 0.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KnowledgeBaseType:
      type: string
      enum:
        - managed
        - external
      title: KnowledgeBaseType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API Key for authentication
      in: header
      name: x-api-key

````