Retrieval

Documents

Fetch the full content of ingested documents by URL or by document ID. URLs can be passed as search results return them. Each document is returned once per page, as the markdown representation of the indexed document.

Results are paginated over the requested documents and each one is truncated to max_chars_per_document to keep response sizes bounded.

post/query/v1/projects/{project_id}/documents/

Request

  • Base URL: https://api.kapa.ai
  • URL: https://api.kapa.ai/query/v1/projects/{project_id}/documents/
  • Auth: one of:
    • API key in cookie sessionid
    • HTTP bearer
    • API key in header X-API-KEY

Path parameters

project_idstring required

The ID of the project.

Request body

source_group_ids_includestring[]

Optional list of source group IDs for filtering retrieval data.

urlsstring[]

The URLs of the documents to fetch, as search results return them. Duplicates are ignored, and surrounding whitespace is removed.

document_idsstring[]

The IDs of the documents to fetch. Duplicate IDs are ignored. Can be combined with urls; at least one of the two is required.

pageinteger

The page of requested documents to return, starting at 1.

page_sizeinteger

The number of requested URLs and document IDs per page.

max_chars_per_documentinteger

Maximum number of characters returned per document. Documents longer than this are truncated and flagged with truncated.

Response

pageinteger required

The returned page number.

page_sizeinteger required

The page size used.

total_itemsinteger required

The total number of matched requests across all pages.

Changes

No recorded changes to this operation across all 1 revision of this API.