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

<Tabs>
  <Tab title="Sync">
    ```python theme={null}
    def update_document_metadata(
        document_id: str,
        metadata: Dict[str, Any],
    ) -> Document
    ```
  </Tab>

  <Tab title="Async">
    ```python theme={null}
    async def update_document_metadata(
        document_id: str,
        metadata: Dict[str, Any],
    ) -> Document
    ```
  </Tab>
</Tabs>

## 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](/concepts/metadata-filtering).

## Returns

* `Document`: Updated document metadata

## Examples

<Tabs>
  <Tab title="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>

  <Tab title="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}")
    ```
  </Tab>
</Tabs>
