List Document

Retrieves all documents in a specific knowledge base.

Endpoint

GET /v1/knowledge-bases/{kb_id}/documents

Parameters

Parameter
Type
Required
Description

kb_id

string

Yes

ID of the knowledge base to list documents from

Authentication

Requires a valid API key or user authentication token.

Response

Returns an array of document objects.

Response Format

[
  {
    "id": "string",
    "knowledge_base_id": "string",
    "name": "string",
    "content_type": "string",
    "size": 0,
    "created_at": "datetime",
    "status": "string",
    "error": "string"
  }
]

Response Fields

Field
Type
Description

id

string

Unique identifier for the document

knowledge_base_id

string

ID of the knowledge base containing the document

name

string

Original filename of the document

content_type

string

MIME type of the document

size

integer

Size of the document in bytes

created_at

datetime

When the document was uploaded

status

string

Processing status ("processing", "ready", "error")

error

string

Error message if processing failed (null if successful)

Example Request

Example Response

Error Responses

Status Code
Description

401

Unauthorized - Invalid or missing API key

403

Forbidden - Not authorized to access this knowledge base

404

Not Found - Knowledge base not found

500

Internal Server Error

Notes

  • Returns documents in reverse chronological order (newest first)

  • Includes all documents regardless of processing status

  • Use the status field to check document availability

  • Processing status updates automatically

  • Documents with "ready" status are available for agent use

  • Error details are provided for failed documents

  • Content type indicates the original file format

Document Status Values

  • processing: Document is being analyzed and indexed

  • ready: Document is processed and available for agent use

  • error: Processing failed, check error field for details

Last updated