---
name: metabase_move_document
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_move_document(client: MetabaseClient, document_id: int, collection_id: int | None) -> dict"
description: "Mueve un document a otra coleccion. Thin wrapper sobre PUT /api/document/:id enviando solo collection_id."
tags: [metabase, document, move, collection, api, python]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [httpx]
params:
  - name: client
    desc: "instancia autenticada de MetabaseClient"
  - name: document_id
    desc: "ID del document a mover"
  - name: collection_id
    desc: "ID de coleccion destino; None mueve a la raiz (Our analytics)"
output: "dict: document actualizado con el nuevo collection_id"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/documents.py"
---

## Ejemplo

```python
# Mover a coleccion 7
doc = metabase_move_document(client, 42, collection_id=7)
print(doc["collection_id"])  # 7

# Mover a raiz
doc = metabase_move_document(client, 42, collection_id=None)
```

## Notas

Equivale a `metabase_update_document(client, document_id, collection_id=collection_id)` pero con
firma explicita para mayor legibilidad en codigo de migracion/reorganizacion.
