Client
Morphik
Main client for document operations in Morphik
Usage
User and Folder Scoping
Morphik supports organizing and isolating data by user and folder. This provides a way to build multi-tenant applications and organize documents across projects.
Quick Overview
For detailed documentation and examples:
- Folder Management - Organizing documents by logical groups
- User Management - Multi-tenant isolation and user-level data management
Constructor
Both clients share the same constructor parameters:
Parameters
uri
(str, optional): Morphik URI in format “morphik://<owner_id>:<token>@<host>”. If not provided, connects to http://localhost:8000 without authentication.timeout
(int, optional): Request timeout in seconds. Defaults to 30.is_local
(bool, optional): Whether connecting to local development server. Defaults to False.
Methods
Morphik provides the following methods. Each method page includes both synchronous and asynchronous versions.
Document Operations
- ingest_text
- ingest_file
- ingest_files
- retrieve_chunks
- retrieve_docs
- query
- list_documents
- get_document
- get_document_by_filename
- update_document_with_text
- update_document_with_file
- update_document_metadata
- update_document_by_filename_with_text
- update_document_by_filename_with_file
- update_document_by_filename_metadata
- delete_document
- delete_document_by_filename
- batch_get_documents
- batch_get_chunks
Knowledge Graph Operations
Cache Operations
Client Management
Context Manager
Using the Morphik client as a context manager ensures that resources are properly closed when the context exits.
Was this page helpful?