curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100"
curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100&next_token=PASTE_TOKEN_FROM_PREVIOUS_RESPONSE"
{
"status": "<string>",
"message": "<string>",
"namespace": "<string>",
"statistics": {},
"statistics.total_items": 123,
"statistics.total_text_chunks": 123,
"statistics.total_summary_chunks": 123,
"statistics.created_at_min": {},
"statistics.created_at_max": {},
"statistics.source_counts": {},
"items": [
{}
],
"items[].id": "<string>",
"items[].text": "<string>",
"items[].metadata": {},
"items[].created_at": "<string>",
"items[].is_summary": true,
"pagination.limit": 123,
"pagination.has_more": true,
"pagination.next_token": {},
"execution_time": 123
}Data Operations
Fetch Text Data
List text and summary chunks from a text namespace with cursor pagination.
GET
/
namespaces
/
{namespace_name}
/
documents
/
fetch-text-data
curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100"
curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100&next_token=PASTE_TOKEN_FROM_PREVIOUS_RESPONSE"
{
"status": "<string>",
"message": "<string>",
"namespace": "<string>",
"statistics": {},
"statistics.total_items": 123,
"statistics.total_text_chunks": 123,
"statistics.total_summary_chunks": 123,
"statistics.created_at_min": {},
"statistics.created_at_max": {},
"statistics.source_counts": {},
"items": [
{}
],
"items[].id": "<string>",
"items[].text": "<string>",
"items[].metadata": {},
"items[].created_at": "<string>",
"items[].is_summary": true,
"pagination.limit": 123,
"pagination.has_more": true,
"pagination.next_token": {},
"execution_time": 123
}Overview
Get text chunks from a text-type namespace. Use this to list stored text and summary chunks for display, export, or bulk RAG context loading. Results are returned one page at a time. Each page returns up to 100 items. 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.
Only namespaces with
type === "text" are supported. Vector-only namespaces are not supported.Path parameters
Query parameters
next_token is tied to the requested namespace. Do not reuse a token from a different namespace.Pagination
1
First request
GET .../fetch-text-data?limit=100 (or omit limit for the default of 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:
GET .../fetch-text-data?limit=100&next_token=<token>4
Stop
Repeat until
pagination.has_more is false or next_token is null.curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100"
curl -X GET "http://localhost:8080/namespaces/my-documents/documents/fetch-text-data?limit=100&next_token=PASTE_TOKEN_FROM_PREVIOUS_RESPONSE"
Response fields
Example response
{
"status": "success",
"message": "Fetched 2 text items from namespace 'my-documents'.",
"namespace": "my-documents",
"statistics": {
"total_items": 2,
"total_text_chunks": 2,
"total_summary_chunks": 0,
"created_at_min": "2025-12-19T18:18:57.370Z",
"created_at_max": "2025-12-19T18:20:01.120Z",
"source_counts": {
"document.pdf": 2
}
},
"items": [
{
"id": "abc123_chunk_0",
"text": "Overview section content...",
"metadata": {
"chunk_index": 0,
"source": "document.pdf"
},
"created_at": "2025-12-19T18:18:57.700Z",
"is_summary": false
}
],
"pagination": {
"limit": 100,
"has_more": false,
"next_token": null
},
"execution_time": 0.012
}
Errors
| Status | Message (examples) |
|---|---|
| 400 | Bad Request: Namespace '...' is not a text-based namespace. |
| 400 | Invalid limit: must be a positive integer. |
| 400 | Invalid next_token: token does not match requested namespace. |
| 404 | Namespace '...' not found. |
| 500 | Internal Server Error during namespace validation. |
Related
- Get items by ID — retrieve specific documents by id
- Upload documents — add text documents to a namespace
- Search — semantic search over namespace content
Was this page helpful?