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
- 200
- 400
- 403
- 404
- 409
- 500
Indexed document text and a continuation cursor, if more chunks remain.
Invalid cursor, changed pagination limit, or invalid query parameters. Parameter validation errors are keyed by field name.
Project access, permission, domain, trial or interaction-limit check failed.
Project or document unavailable, including stale references and references from another project. Search again for a current document ID.
Recrawl this source to enable complete document retrieval, then search again.
Document retrieval is temporarily unavailable. Retry later.