documents.get
Retrieves specific documents by their IDs from a namespace. This endpoint allows you to fetch documents that have been previously uploaded and indexed.This method retrieves documents that have been previously uploaded and indexed in the specified namespace. For semantic search and similarity-based retrieval, use the Search API.
Parameters
The name of the namespace containing the documents.
A list of document IDs to retrieve (max 100 IDs per request).
Dict[str, Any] - A dictionary containing the retrieved documents.
Raises: NamespaceNotFound, InvalidInputError.
Example
Get Documents Example
Response Structure
The response contains:status(str): “success” or “partial”message(str): Human-readable messagerequested_ids(int): Number of document IDs requestedfound_items(int): Number of documents successfully founditems(list): Array of retrieved document objectsnot_found_ids(list, optional): IDs that were not found (for partial success)
Complete Example
Complete Example
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 optimized batch retrieval for performance
- Flexible IDs: Document IDs can be strings or numbers
Best Practices
- Use the maximum batch size (100 documents) when possible
- Group related document retrievals to minimize API calls
- Always check the
found_itemscount vsrequested_ids - Handle partial success responses gracefully
- Cache frequently accessed documents client-side
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
Related Operations
- Upload Text Data - Add new text documents
- Upload Vector Data - Add new vector embeddings
- Delete Data - Remove specific documents
- Search - Find documents using semantic search