> Documentation index: https://docs.hodeishield.com/llms.txt

# `/v1` reference: Reports

The operations of this resource. They share the pagination and error vocabulary described in [Overview](https://docs.hodeishield.com/en/api/overview/) and [Errors](https://docs.hodeishield.com/en/api/errors/). Example values on this page are **fictitious**. The other operations are in the [complete reference](https://docs.hodeishield.com/en/api/reference/).

## Operations

### List generated reports

`GET /v1/reports`

The reports generated for the tenant, newest first by default. Metadata only: the report itself is fetched as a file with `downloadReport` once its `status` is `completed`. To pick up new ones, use `since` with `order=asc`.

**Required scope:** `reports:read`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `page` | query | no | `integer` | 1-based page number. Defaults to 1. |
| `per_page` | query | no | `integer` | Items per page, 1..200. Defaults to 50. |
| `sort` | query | no | `enum(created_at, period_end)` | Field to order by. One of: created_at, period_end. |
| `order` | query | no | `enum(asc, desc)` | Sort direction. Defaults to desc. |
| `report_type` | query | no | `string` | Exact type match. Known values: monthly, vendor_risk, nis2_compliance, ens, cyberbrief, compliance, security_posture, board_report. Open vocabulary: any other value is matched exactly and matches nothing. |
| `status` | query | no | `string` | Exact status match. Known values: generating, completed, failed. Open vocabulary: any other value is matched exactly and matches nothing. |
| `since` | query | no | `string` | Only reports created at or after this RFC 3339 instant. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Example response (200, fictitious values):**

```json
{
  "data": [
    {
      "id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "report_type": "board_report",
      "title": "Informe del consejo T3",
      "period_start": "2026-07-01",
      "period_end": "2026-09-30",
      "status": "completed",
      "created_at": "2026-10-01T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 50,
    "total": 12,
    "total_pages": 1
  }
}
```

### Fetch one report

`GET /v1/reports/{id}`

The same object as the collection, for a single report by id, plus the formats it can be downloaded in now (`download_formats`): empty while it is not `completed`, or when its content has no renderer (then download it from the console as Markdown or JSON).

**Required scope:** `reports:read`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `id` | path | yes | `string` | Report identifier. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Example response (200, fictitious values):**

```json
{
  "data": {
    "id": "7a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
    "report_type": "board_report",
    "title": "Informe del consejo T3",
    "period_start": "2026-07-01",
    "period_end": "2026-09-30",
    "status": "completed",
    "created_at": "2026-10-01T08:00:00Z",
    "download_formats": [
      "pdf",
      "xlsx"
    ]
  }
}
```

### Download a report file

`GET /v1/reports/{id}/download`

The report as a file (PDF or XLSX), in the response body with `Content-Disposition: attachment`; never a link. Each delivery is recorded in the tenant’s audit trail with the credential that received it. It answers `409` with `error.details.code`: `REPORT_NOT_READY` when the report is still generating or failed (`error.details.status`), `FORMAT_UNSUPPORTED` when its content has no renderer for that format (`error.details.formats` lists the ones it has) and `FILE_TOO_LARGE` when the file exceeds the size the operation serves (`error.details.limit_bytes`, 20 MiB); none of the three sends the file.

**Required scope:** `reports:read`

**Parameters:**

| Parameter | In | Required | Type | Description |
|---|---|---|---|---|
| `id` | path | yes | `string` | Report identifier. |
| `format` | query | no | `enum(pdf, xlsx)` | File format, one of: pdf, xlsx. Defaults to pdf. `getReport` lists the formats a report can be served in (`download_formats`). |
| `locale` | query | no | `enum(es, en, de, fr, it, eu)` | Language of the file, one of: es, en, de, fr, it, eu. Defaults to en. |
| `X-HS-Tenant` | header | no | `string` | The tenant to read, as its id (a UUID, any case). REQUIRED with a portfolio key (`hsp_…`); with a tenant API key or an OAuth token, optional and accepted only when it equals the credential’s own tenant. Never a slug. |

**Response (200, fictitious values):** The body is the binary file, not JSON. Example headers:

```http
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="Informe_del_consejo_T3.pdf"
Content-Length: 184213
X-HS-Tenant: 0b8f2a52-6a0e-4d5c-9d3e-1f2a3b4c5d6e
```
