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

# PDF reports

> Download a LENS view as a PDF report by adding /pdf to its endpoint - the same data, access rules and tier as the JSON endpoint, laid out the way the view shows it in TIC LENS.

Most views in TIC LENS can be downloaded as a PDF report, and the API offers the same reports: add `/pdf` to the endpoint the view reads from. The report shows the endpoint's data the way the view lays it out - its sections, columns, order and wording - with the TIC header, the subject (for example the company name and organisation number) and the date it was produced.

* The report is rendered on request from the same endpoint, so access checks, masking (for example of protected persons) and the tier are the JSON endpoint's.
* Reports are not stored and are not orders.
* The pages are in landscape, A4.

The reports are listed under **PDF reports** in each area of the navigation.

## Two kinds of report

### Views from a GET endpoint

Add `/pdf` to the path and send a GET request:

```bash theme={null}
curl "https://lens-api.tic.io/companies/12345/representatives/pdf?lang=en" \
  -H "x-api-key: YOUR_API_KEY" \
  -o representatives.pdf
```

Some reports combine the endpoints their view shows together, for example business mortgages with their register cases and entries. Each report page links to the endpoints it is built from.

### Views with a grid (POST endpoints)

Grid endpoints (see [Pagination](/api-lens/pagination)) take a POST with a `filterModel` and a `sortModel`. Their reports are a POST to the same path plus `/pdf`, with the same body, so the report holds the rows the grid shows:

```bash theme={null}
curl -X POST "https://lens-api.tic.io/addresses/12345/companies/pdf?lang=en" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "filterModel": {}, "sortModel": [{ "colId": "c_LegalName", "sort": "asc" }] }' \
  -o companies.pdf
```

`startRow` and `endRow` are ignored. An empty body (or none) means no filter and the endpoint's default order.

## Language

| Source | Example |
| - | - |
| `lang` query parameter | `?lang=en` |
| `X-User-Locale` header, when `lang` is not given | `X-User-Locale: en-US` |
| The team's language, when neither is given | |

Reports come in `sv` and `en`. A value starting with `sv` gives `sv`; any other value gives `en`.

## Response

A successful call returns `200` with `Content-Type: application/pdf` and a `Content-Disposition` header naming the file after the report and its subject, for example `TIC representatives 556677-8899.pdf`.

Errors are the JSON endpoint's: `404` when the subject does not exist or is not accessible, `401` without a valid API key and `403` when the team's tier does not include the endpoint.

## Row limit

A report holds at most **1,000 rows** per table. When a result has more, the report says so above the rows:

* For a list, it gives the number of rows shown and the total.
* For a grid, whose total is not known in advance, it says that the result has more rows. Narrow the result with `filterModel` to include the rest.

For complete data, use the JSON endpoint with [pagination](/api-lens/pagination), or its CSV export where the endpoint has one.


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