> ## 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.

# update_document_metadata

> Update a document's metadata only

> [tab] Sync
>
> ```python theme={null}
> def update_document_metadata(
>     document_id: str,
>     metadata: Dict[str, Any],
> ) -> Document
> ```

> [tab] Async
>
> ```python theme={null}
> async def update_document_metadata(
>     document_id: str,
>     metadata: Dict[str, Any],
> ) -> Document
> ```

## Parameters

* `document_id` (str): ID of the document to update
* `metadata` (Dict\[str, Any]): Metadata to update

### Typed Metadata

You can supply Python `datetime`, `date`, `Decimal`, and numeric types in `metadata`. The SDK serializes them with the correct `metadata_types`, so subsequent filters can leverage the operators from the [Metadata Filtering guide](https://morphik.ai/docs/concepts/metadata-filtering.md).

## Returns

* `Document`: Updated document metadata

## Examples

> [tab] Sync
>
> ```python theme={null}
> from morphik import Morphik
>
> db = Morphik()
>
> # Update just the metadata of a document
> updated_doc = db.update_document_metadata(
>     document_id="doc_123",
>     metadata={"status": "reviewed", "reviewer": "Jane Smith"}
> )
> print(f"Updated metadata: {updated_doc.metadata}")
> ```

> [tab] Async
>
> ```python theme={null}
> from morphik import AsyncMorphik
>
> async with AsyncMorphik() as db:
>     # Update just the metadata of a document
>     updated_doc = await db.update_document_metadata(
>         document_id="doc_123",
>         metadata={"status": "reviewed", "reviewer": "Jane Smith"}
>     )
>     print(f"Updated metadata: {updated_doc.metadata}")
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.