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

# Log in

> Authenticates with email and password. If valid, sets an HttpOnly cookie with the session JWT.

## Request body

A JSON object with both fields as text. If either is missing, empty or not text, it returns `400`.

**email** `string` *required*

User's email address.

**password** `string` *required*

User's password.

> [!NOTE]
>
> The JWT is **not** returned in the response body. It is set
> automatically as the HttpOnly cookie `access_token_cookie`. Later calls
> to protected endpoints must include this cookie. Logging in
> also creates the `csrf_access_token` cookie: its value goes in the
> `X-CSRF-TOKEN` header of session requests other than `GET`.

## Response

**success** `boolean`

`true` if authentication succeeded.

**\_id** `string`

ROR identifier of the institution associated with the user.

**institution** `string`

Name of the institution.

**role** `string`

User's role on the platform (`admin`, `staff`, etc.).

```json 200 theme={null}
{
  "success": true,
  "_id": "example-institution-id",
  "institution": "Universidad Ejemplo",
  "role": "staff"
}
```

```json 400 theme={null}
{"msg": "correo y contraseña requeridos", "success": false}
```

```json 400 — invalid body theme={null}
{ "success": false, "msg": "El cuerpo de la petición debe ser un objeto JSON." }
```

```json 401 theme={null}
{"msg": "Usuario con correo usuario@example.com no encontrado o contraseña no conciden", "success": false}
```

```json 403 theme={null}
{ "success": false, "msg": "El usuario está desactivado. Contacte al administrador del sistema" }
```


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