> ## Documentation Index
> Fetch the complete documentation index at: https://help.impactu.colav.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create user

> Creates a new user on the platform and emails them their password. Only accessible with the admin role.

> [!NOTE]
>
> Requires an active session with the `admin` role. The email with the
> credentials is sent first and then the user is saved: if the email cannot
> be sent, it returns `502` and nothing is created, so it can be retried.

## Path parameters

**email** `string` *required*

Email address of the new user. If it doesn't have a valid format, it returns
`400`.

## Request body

It must have exactly these three fields, with non-empty text: if any is missing, extra or empty, it returns `400`.

**institution** `string` *required*

Name of the institution the user belongs to.

**ror\_id** `string` *required*

ROR identifier of the institution. Example: `059yx9a68`. Each institution
has a single user: if one already exists for that `ror_id`, it returns `409`.

**role** `string` *required*

User's role on the platform. Example: `staff`. It cannot be `admin`: it returns `403`.

## Response

**success** `boolean`

`true` if the user was created successfully.

**msg** `string`

Confirmation or error message.

```json 201 theme={null}
{
  "success": true,
  "msg": "Usuario usuario@example.com Creado exitosamente y contraseña enviada por correo electrónico."
}
```

```json 400 theme={null}
{ "success": false, "msg": "Faltan: ror_id" }
```

```json 400 — invalid email theme={null}
{ "success": false, "msg": "El correo 'usuario@example' no es válido." }
```

```json 409 theme={null}
{
  "success": false,
  "msg": "Para la institución: Universidad Ejemplo ya existe un correo registrado: otro@example.com. Si deseas asignar un nuevo correo, edita el usuario existente."
}
```

```json 409 — existing email theme={null}
{ "success": false, "msg": "El usuario con correo usuario@example.com ya existe." }
```

```json 401 theme={null}
{"msg": "Token no proporcionado o inválido. Por favor, inicia sesión nuevamente.", "success": false}
```

```json 403 theme={null}
{ "success": false, "msg": "Permiso denegado: No pueden realizar esta acción." }
```

```json 403 — admin role theme={null}
{ "success": false, "msg": "No se pueden crear usuarios con el role 'admin'." }
```

```json 502 theme={null}
{ "success": false, "msg": "No se pudo enviar el correo con las credenciales. No se guardó ningún cambio." }
```


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