| title | batch_get_documents |
|---|---|
| description | Retrieve multiple documents by their IDs in a single batch operation |
document_ids(List[str]): List of document IDs to retrievefolder_name(str | List[str], optional): Optional folder scope. Accepts canonical paths or a list of paths/names.
List[Document]: List of document metadata for found documents
db = Morphik()
docs = db.batch_get_documents(["doc_123", "doc_456", "doc_789"])
for doc in docs:
print(f"Document {doc.external_id}: {doc.metadata.get('title')}")
```
async with AsyncMorphik() as db:
docs = await db.batch_get_documents(["doc_123", "doc_456", "doc_789"])
for doc in docs:
print(f"Document {doc.external_id}: {doc.metadata.get('title')}")
```
Each Document object in the returned list has the following properties:
external_id(str): Unique document identifiercontent_type(str): Content type of the documentfilename(Optional[str]): Original filename if availablemetadata(Dict[str, Any]): User-defined metadatastorage_info(Dict[str, str]): Storage-related informationsystem_metadata(Dict[str, Any]): System-managed metadatachunk_ids(List[str]): IDs of document chunksfolder_path(Optional[str]): Canonical folder path (includes nested parents when scoped)