---
name: metabase_create_user
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def metabase_create_user(client: MetabaseClient, first_name: str, last_name: str, email: str, password: str = '', group_ids: list[int] | None = None) -> dict"
description: "Crea un nuevo usuario en Metabase. Sin password envia invitacion por email. Requiere superusuario. Endpoint: POST /api/user."
tags: [metabase, user, create, 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: first_name
    desc: "nombre del usuario"
  - name: last_name
    desc: "apellido del usuario"
  - name: email
    desc: "correo único del usuario"
  - name: password
    desc: "contraseña (vacío envía invitación por email)"
  - name: group_ids
    desc: "lista de IDs de grupos a los que agregar el usuario"
output: "dict: objeto usuario creado con id y metadata"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/metabase/users.py"
---

## Ejemplo

```python
user = metabase_create_user(client, "John", "Doe", "john@example.com", "pass123")
user = metabase_create_user(client, "Jane", "Smith", "jane@example.com", group_ids=[1, 3])
```

## Notas

Email debe ser unico. Error 400 si ya existe.
