documents.fetch_text_data
Lists stored text and summary chunks for a text namespace. Use it for export, UI, or bulk RAG context loading. Results are returned one page at a time (up to 100 items per page). When more data exists, the response includespagination.has_more and pagination.next_token — pass that token on the next request to fetch the following page.
Parameters
str
required
The name of the target text namespace.
int
Maximum number of items to return in this page. Must be between 1 and 100. Omit to use the API default (100).
str
Opaque cursor from the previous response’s
pagination.next_token. Omit on the first request. Do not reuse a token from a different namespace or account.FetchTextDataResponse — keys are snake_case: status, message, namespace, statistics, items, pagination, execution_time.
Raises: NamespaceNotFound, InvalidInputError, AuthenticationError, APIError.
Example (sync, first page)
Fetch Text Data Example
Example (async)
Fetch Text Data Async Example
Pagination
1
First request
Call without
next_token (optionally set limit, max 100).2
Check pagination
If
pagination.has_more is true, more chunks exist in the namespace.3
Next page
Call again with
next_token from the previous response.4
Stop
Repeat until
pagination.has_more is false or next_token is null.Fetch all pages
Response overview
items: Text chunks for this page (length ≤limit, max 100). Each item hasid,text, optionalmetadata,created_at(ISO 8601 string ornull), andis_summary.statistics: Aggregated counts for this page only — e.g.total_items,total_text_chunks,total_summary_chunks,created_at_min,created_at_max,source_counts(created_at_min/created_at_maxmay benull).pagination:limit,has_more, andnext_token(nullwhen there is no next page).message: Human-readable summary for this page (e.g. “Fetched N text items from namespace ’…’”).
Complete example
Fetch Text Data Full Example
Important Notes
Text namespaces only: Vector-only namespaces are not supported for this route. The API returns an error if the namespace is not text-based.
Per-page statistics:
statistics describes only the items in the current items array, not the full namespace total.Best practices
- Treat
itemsas read-only chunks for display or export; use Search for similarity queries. - Rely on snake_case keys in Python (
is_summary,created_at,next_token, etc.). - Pass
limitbetween 1 and 100; invalid values raiseInvalidInputErrorbefore the request is sent.
Related operations
- Get Documents - Retrieve specific documents by ID
- Search - Semantic search over namespace content
- Fetch Text Data (API) - HTTP reference for the same endpoint