> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gu1.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Jobs de exportación de reportes

> Listá y descargá archivos async generados desde Reportería, presets o la acción Generar reporte.

## Overview

Cada **Generar** desde Reportería, un preset o la acción de automation **Generar reporte** (`send_report`) encola un job de exportación y guarda el archivo en object storage. Usá estos endpoints para listar **Descargables** y volver a bajar el archivo con sesión autenticada (no es un link público permanente).

| Method | Path                                          | Use                                                                   |
| ------ | --------------------------------------------- | --------------------------------------------------------------------- |
| `GET`  | `/report-export-jobs`                         | Listar jobs de reportes (filtro `presetId`, `templateCode`, `status`) |
| `GET`  | `/report-export-jobs/{kind}/{jobId}/download` | Descarga autenticada                                                  |

`kind` es uno de: `entities`, `transactions`, `investigations`, `alerts`, `documents` (ficha de entidad en PDF y reportes de métricas).

La retención del archivo se informa por job en `fileExpiresAt`. Un valor `null`
significa que el archivo no caduca. Las exportaciones nuevas de entidades y
transacciones usan `null`; los demás tipos mantienen su período de retención
configurado. Este campo es independiente de `linkExpiresAt`, que solo marca cuándo
vence el enlace firmado enviado por correo.

## Authentication and tenant

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY` — ver [Authentication](/es/api-reference/authentication).
</ParamField>

<ParamField header="X-Organization-ID" type="string" required>
  UUID de organización production o sandbox — ver [Environments](/es/api-reference/environments).
</ParamField>

## Permissions

| Endpoint       | Granular permission |
| -------------- | ------------------- |
| `GET` list     | `reports:read`      |
| `GET` download | `reports:export`    |

## List jobs

```
GET http://api.gu1.ai/report-export-jobs
```

<ParamField query="presetId" type="string">
  UUID opcional — solo jobs de ese [preset de reporte](/es/api-reference/entities/report-presets).
</ParamField>

<ParamField query="templateCode" type="string">
  Código de plantilla opcional (por ejemplo `alerts_by_rules`).
</ParamField>

<ParamField query="status" type="string">
  Estado opcional (`queued`, `running`, `completed`, `completed_email_failed`, `failed`).
</ParamField>

<ParamField query="limit" type="integer">
  Tamaño de página (1–100, default 50).
</ParamField>

<ParamField query="offset" type="integer">
  Offset de paginación (default 0).
</ParamField>

### Response

```json theme={null}
{
  "success": true,
  "jobs": [
    {
      "id": "…",
      "kind": "alerts",
      "status": "completed",
      "outputFilename": "alerts-by-rules-2026-08-06.xlsx",
      "fileExpiresAt": "2026-08-07T12:00:00.000Z",
      "linkExpiresAt": "2026-08-07T12:00:00.000Z",
      "downloadAvailable": true,
      "reportSource": "preset",
      "reportPresetId": "…",
      "reportTemplateCode": "alerts_by_rules",
      "createdAt": "2026-08-06T12:00:00.000Z"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}
```

## Download a job file

```
GET http://api.gu1.ai/report-export-jobs/{kind}/{jobId}/download
```

Devuelve el binario con `Content-Disposition: attachment`. Códigos:

| Status | Meaning                        |
| ------ | ------------------------------ |
| `200`  | Cuerpo del archivo             |
| `404`  | Job no encontrado en el tenant |
| `409`  | Job aún no listo               |
| `410`  | Archivo eliminado              |

Ver también [Plantillas de reportes](/es/api-reference/entities/report-templates) y [Presets de reportes](/es/api-reference/entities/report-presets).
