Documentation Index
Fetch the complete documentation index at: https://morphik.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
def get_document_status(
document_id: str,
) -> Dict[str, Any]
async def get_document_status(
document_id: str,
) -> Dict[str, Any]
Parameters
document_id (str): ID of the document to check
Returns
Dict[str, Any]: Status information including current status, potential errors, and other metadata
Examples
from morphik import Morphik
db = Morphik()
# Check document processing status
status = db.get_document_status("doc_123abc")
print(f"Status: {status.get('status')}")
if status.get('error'):
print(f"Error: {status.get('error')}")
# Use in a polling loop
import time
while True:
status = db.get_document_status("doc_123abc")
if status.get('status') == 'completed':
print("Document processing complete!")
break
elif status.get('status') == 'failed':
print(f"Document processing failed: {status.get('error')}")
break
time.sleep(2)
from morphik import AsyncMorphik
import asyncio
async with AsyncMorphik() as db:
# Check document processing status
status = await db.get_document_status("doc_123abc")
print(f"Status: {status.get('status')}")
if status.get('error'):
print(f"Error: {status.get('error')}")
# Use in a polling loop
while True:
status = await db.get_document_status("doc_123abc")
if status.get('status') == 'completed':
print("Document processing complete!")
break
elif status.get('status') == 'failed':
print(f"Document processing failed: {status.get('error')}")
break
await asyncio.sleep(2)
Notes
- Common status values include:
"processing", "completed", "failed"
- This is a lightweight endpoint useful for checking progress without fetching the full document.
- The SDK also provides a helper method for polling: see the document ingestion methods which can wait for completion automatically.