---
title: "Get a knowledge base (with documents)"
method: GET
path: "/v1/knowledgebases/{id}"
tags: ["Knowledge Bases"]
---

# Get a knowledge base (with documents)

`GET /v1/knowledgebases/{id}`

## Request

- Base URL: `https://api.pyai.com`
- URL: `https://api.pyai.com/v1/knowledgebases/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

## Path parameters

- `id` string, required

## Response `200`

Knowledge base with its documents

- KnowledgebaseWithDocuments
  - `id` string
  - `orgId` string
  - `name` string
  - `embedModel` string
  - `docCount` integer
  - `bytes` integer
  - `status` 'active' | 'deleted'
  - `createdAt` integer: Unix ms.
  - `documents` KbDocument[]
    - `id` string
    - `kbId` string
    - `orgId` string
    - `source` 'upload' | 'url' | 'api': upload = file, url = fetched page, api = pasted text.
    - `uri` string, nullable
    - `title` string, nullable
    - `filename` string, nullable
    - `mime` string, nullable
    - `sizeBytes` integer
    - `chunks` integer: Indexed chunk count (0 until indexed).
    - `status` 'pending' | 'indexed' | 'failed'
    - `error` string, nullable: Human-readable failure/stall reason.
    - `indexedAt` integer, nullable: Unix ms.
    - `createdAt` integer: Unix ms.

## Other responses

- `404`: Resource not found (`code: not_found`)

---

[API](https://skmtc.dev/pyai/apis/pyai-api.md) · [All operations](https://skmtc.dev/pyai/apis/pyai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pyai/apis/pyai-api/revisions/819d8e7c4d09?raw)
