Skip to main content

Get indexed document text

GET 

/api/v2/projects/:slug/documents/:document_id/

Read a document's indexed text. First search with source_types=all and copy a result's document_id. The response contains text chunks in reading order, with available page or worksheet references. It does not return the original file or live page content.

Responses contain up to 20 chunks. If next_cursor is not null, send it as cursor in the next request, keeping the same document_id and limit. Repeat until next_cursor is null.

After refreshing sources, or if a document returns 404, search again for a current document ID. If the endpoint returns 409, recrawl the source and search again.

Each successful request, including each pagination request, uses one interaction and does not create a chat. See extra usage for allowances and charges.

Required permission: search (private projects only).

Request​

Responses​

Indexed document text and a continuation cursor, if more chunks remain.