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

# Reports

> Generate a self-contained HTML visibility report for a project.

## Generate report

```http theme={null}
GET /projects/{project_id}/report
```

Returns a rendered HTML report instead of the standard JSON response envelope.

### Query parameters

| Param           | Type    | Default  | Description                        |
| --------------- | ------- | -------- | ---------------------------------- |
| `duration_days` | integer | `30`     | Lookback window from 1 to 365 days |
| `date_from`     | string  | --       | Explicit start date (`YYYY-MM-DD`) |
| `date_to`       | string  | --       | Explicit end date (`YYYY-MM-DD`)   |
| `format`        | string  | `inline` | `inline` or `download`             |

When `date_from` and `date_to` are provided, they take precedence over `duration_days`.

```bash theme={null}
curl "https://topify-customer-api-production.up.railway.app/api/public/v1/projects/{project_id}/report?duration_days=30&format=download" \
  -H "X-API-Key: tk_live_..." \
  -o topify-report.html
```

For `format=download`, the response includes a `Content-Disposition` header when provided by the report service.

### Error responses

| Status | Cause                                             |
| ------ | ------------------------------------------------- |
| `403`  | The API key's team cannot access the project      |
| `422`  | Invalid date, duration, or format parameter       |
| `502`  | The report backend is unavailable                 |
| `504`  | Report generation exceeded the 120-second timeout |
