Data Operations
Get Documents
Retrieve specific documents by their IDs from a namespace. This endpoint allows you to fetch documents that have been previously uploaded and indexed.
POST
Overview
Retrieve specific documents by their IDs from a namespace. This endpoint allows you to fetch documents that have been previously uploaded and indexed. Only documents that exist in the namespace will be returned - non-existent document IDs will be ignored without causing an error.This endpoint retrieves documents that have been previously uploaded and indexed in the specified namespace. For semantic search and similarity-based retrieval, use the Search API.
Authentication
Your API key for authentication
Must be
application/jsonPath Parameters
Name of the namespace containing the documents
Request Body
Array of document IDs to retrieve (cannot be empty, max 100 IDs per request)
IDs to use: Use the same chunk/document IDs you provided when uploading text via the public Upload Text API. Pass those IDs in the
ids array to retrieve the corresponding documents.Response Fields
Success Response (200)
Always “success” for 200 responses
Human-readable confirmation message
Number of document IDs requested
Number of documents successfully found and retrieved
Array of retrieved document objects
Document Object
Unique identifier of the document
Text content of the document
Additional metadata associated with the document
Partial Success Response (207)
Always “partial” for 207 responses
Human-readable message describing the partial success
Number of document IDs requested
Number of documents successfully found and retrieved
Array of document IDs that were not found
Array of successfully retrieved document objects
Key Features
Batch Retrieval
Retrieve up to 100 documents in a single request
Partial Success
Non-existent document IDs are ignored without causing errors
Efficient Processing
Uses DynamoDB BatchGetItem for optimal performance
Flexible IDs
Document IDs can be strings or numbers
Performance Considerations
Batch Size Optimization
Batch Size Optimization
- Use the maximum batch size (100 documents) when possible
- Group related document retrievals to minimize API calls
- Consider document size when batching large documents
- Monitor response times for optimal batch sizes
Error Handling
Error Handling
- Always check the found_items count vs requested_ids
- Handle 207 responses gracefully for partial success
- Implement retry logic for 500 errors with exponential backoff
- Log missing document IDs for debugging
Caching Strategy
Caching Strategy
- Cache frequently accessed documents client-side
- Use document IDs as cache keys for efficient lookups
- Consider TTL based on document update frequency
- Implement cache invalidation for document updates
Use Cases
- Document Retrieval: Fetch specific documents by ID for display or processing
- Content Management: Access and manage previously uploaded documents
- Data Export: Extract documents for backup or migration purposes
- Quality Assurance: Review uploaded content for accuracy and completeness
- Integration: Sync document data with external systems and applications
- Debugging: Investigate and verify document content and metadata
Related Endpoints
- Upload Text Data - Add new text documents
- Upload Vector Data - Add new vector embeddings
- Search - Find documents using semantic search
- Delete Data - Remove specific documents