Reports

We want to provide maximum flexibility for you when consuming reports from the API. So we use a ReportResponse model.

Whenever you request a report, such as a P11 or Papdis File we will examine the accept header to determine how to respond.
The accept headers that are supported can vary from report to report, but they're listed on the relevant page of the API documentation.

The type property of the ReportResponse will contain the accept header you provided. The response can also contain model, content, and stream properties. Which properties contain your response depends on the accept header you provided.

application/octet-stream (recommended for PDF files)

Use application/octet-stream to retrieve a PDF through the authenticated API. The stream property contains the PDF bytes and the content property contains the filename.

application/pdf

Deprecated: the content property provides a link to a PDF file. Migrate to application/octet-stream. The end-of-life date for PDF-link responses is 1st February 2027.

When Accept: application/pdf is used, responses include HTTP deprecation signals: Deprecation: @<unix-seconds> (RFC 9745 Structured Field Date for 1st October 2026), Sunset (HTTP-date for 1st February 2027), Warning, and optionally Link pointing at migration documentation. These headers are not returned for application/octet-stream responses. Cross-origin browser clients can read them via Access-Control-Expose-Headers.

application/json

The model property contains a JSON representation of the relevant model.

text/html

The content contains a JSON encoded HTML string representing your HTML document. In some cases, such as Payslips there are multiple HTML documents to be returned. In these cases the content property will be blank and the model property will contain an array of JSON encoded HTML strings.

text/csv, text/xml

In cases like these where the content can be represented as a string then the relevant data (csv, xml) will be JSON encoded as a string in the content property.