Skip to main content
GET
/
api
/
knowledge-base
List Documents
curl --request GET \
  --url https://api.example.com/api/knowledge-base \
  --header 'X-API-Key: <x-api-key>' \
  --header 'X-Organization-Id: <x-organization-id>'
{
  "success": true,
  "data": [
    {
      "documentation_id": "doc_a1b2c3d4e5f6",
      "name": "Product Manual.pdf",
      "type": "file",
      "size": 2450000,
      "filename": "Product Manual.pdf",
      "processing_status": "completed",
      "page_count": 42,
      "vector_count": 156,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-16T14:45:00Z"
    },
    {
      "documentation_id": "doc_b2c3d4e5f6a7",
      "name": "FAQ Text",
      "type": "text",
      "word_count": 1250,
      "processing_status": "completed",
      "vector_count": 32,
      "created_at": "2024-01-10T09:00:00Z",
      "updated_at": "2024-01-10T09:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
    "has_more": true,
    "page_size": 30
  }
}
List all knowledge base documents for your organization with pagination and filtering.

Headers

X-API-Key
string
required
Your API key for authentication.
X-Organization-Id
string
required
The organization ID.

Query Parameters

cursor
string
Pagination cursor for the next page.
page_size
integer
default:"30"
Number of documents per page (1-100).
Search by document name.
types
array
Filter by document types (file, text). Can specify multiple.
sort_by
string
default:"created_at"
Field to sort by: name, created_at, updated_at, or size.
sort_direction
string
default:"desc"
Sort direction: asc or desc.

Permissions

  • kb:read (all roles)

Response

success
boolean
Indicates if the request was successful.
data
array
List of document summary objects.
pagination
object
Pagination metadata.
{
  "success": true,
  "data": [
    {
      "documentation_id": "doc_a1b2c3d4e5f6",
      "name": "Product Manual.pdf",
      "type": "file",
      "size": 2450000,
      "filename": "Product Manual.pdf",
      "processing_status": "completed",
      "page_count": 42,
      "vector_count": 156,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-16T14:45:00Z"
    },
    {
      "documentation_id": "doc_b2c3d4e5f6a7",
      "name": "FAQ Text",
      "type": "text",
      "word_count": 1250,
      "processing_status": "completed",
      "vector_count": 32,
      "created_at": "2024-01-10T09:00:00Z",
      "updated_at": "2024-01-10T09:00:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJkb2N1bWVudGF0aW9uX2lkIjogImRvY194eXoifQ==",
    "has_more": true,
    "page_size": 30
  }
}