---
title: "List documents in a knowledge base"
method: GET
path: "/v1/knowledgebases/{id}/documents"
tags: ["Knowledge Bases"]
---

# List documents in a knowledge base

`GET /v1/knowledgebases/{id}/documents`

## Request

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

## Path parameters

- `id` string, required

## Response `200`

Documents

- KbDocumentList
  - `object` string
  - `data` 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.
  - `has_more` boolean

## 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/271a1539185b?raw)
