---
name: metabase_archive_snippet
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_archive_snippet(client: MetabaseClient, snippet_id: int) -> dict"
description: "Archiva un SQL snippet en Metabase. Wrapper sobre metabase_update_snippet con archived=True."
tags: [metabase, snippet, archive, api, python, pendiente-usar]
uses_functions: [metabase_update_snippet_py_infra]
uses_types: [MetabaseClient_go_infra]
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [httpx]
params:
  - name: client
    desc: "instancia autenticada de MetabaseClient"
  - name: snippet_id
    desc: "ID numerico del snippet a archivar"
output: "dict: snippet con archived=True y updated_at actualizado"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/snippets.py"
---

## Ejemplo

```python
# Archivar snippet obsoleto
result = metabase_archive_snippet(client, 42)
print(result["archived"])  # True

# Listar snippets activos despues de archivar
active = metabase_list_snippets(client, archived=False)
assert all(not s["archived"] for s in active)
```

## Notas

Los snippets archivados no aparecen en el autocomplete de queries nativas en el editor de Metabase.
Las cards que ya referencian el snippet siguen funcionando correctamente despues de archivar.
Para desarchivar, usar metabase_update_snippet(client, snippet_id, archived=False).
