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

# Generate API key

> Generates or regenerates the authenticated user's API key. If one already existed, it is replaced.

> [!NOTE]
>
> The authenticated user can only manage their own API key. The `{email}`
> in the path must match the identity of the JWT in the cookie
> `access_token_cookie`.

## Path parameters

**email** `string` *required*

User's email address. It must match the authenticated user.

## Request body

**expires** `integer`

Expiration date in Unix seconds. Optional. If given, it must be
a future date at least 1 day ahead.

## Response

**success** `boolean`

`true` if the API key was generated successfully.

**apikey** `object`

Data of the generated API key.

**properties**

**id** `string`

The API key: 10 letters and digits. Keep it in a safe place; it is not
shown again.

**expires** `integer`

Expiration date in Unix seconds. `null` if no expiration was
set.

```json 200 theme={null}
{
  "success": true,
  "apikey": {
    "id": "aB3dE5fG7h",
    "expires": 1830000000
  }
}
```

```json 400 theme={null}
{ "success": false, "msg": "La expiración mínima del API key es de 1 día" }
```

```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": "No tienes permiso para gestionar el API Key de otro usuario." }
```


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