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

# Export analytics

> POST /analytics/qr/export/

Exports aggregated analytics — every metric type the account's plan allows (`count`, `date`, `qr`, `utm`, `device`, `os`, `browser`, `geography`, and more) — as a downloadable file, rather than a single JSON payload scoped to one `type` like [QR analytics](/api-reference/management-api/analytics/qr-analytics) requires.

<Warning>
  This is a **POST-only** endpoint — a `GET` request returns `405 Method Not Allowed`. The `management-api.json` spec previously listed it as `GET`; this has been corrected.
</Warning>

<Note>
  Requires a Management API key with `MANAGEMENT_API` quota — see the [Management API overview](/api-reference/management-api/overview) — plus the account's `EXPORT_ANALYTICS_REPORT` quota and `ANALYTICS_CAN_EXPORT` permission. A 403 with `"Your plan does not have export analytics report quota."` means the plan doesn't include exports.
</Note>

## Request

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://management.scanova.io/analytics/qr/export/?from=2026-07-01&to=2026-08-16&file_format=xlsx' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "q": ["Q07afe81aa0034c01"],
      "filter_by": "qrid"
    }' \
    --output analytics.xlsx
  ```
</RequestExample>

This endpoint always returns a binary file, not JSON — see the response formats below.

### Query parameters

<ParamField query="from" type="string" required>
  Start date (`YYYY-MM-DD`), inclusive.
</ParamField>

<ParamField query="to" type="string" required>
  End date (`YYYY-MM-DD`), inclusive.
</ParamField>

<ParamField query="file_format" type="string" required>
  `csv`, `xls`, `xlsx`, or `pdf`. Any other value (or omitting it) returns a `400` with `"Invalid file format"`.
</ParamField>

<ParamField query="exclude_bot_scan" type="boolean" default="false">
  Excludes bot-identified scans from the export.
</ParamField>

### Request body

Same shape as [QR analytics](/api-reference/management-api/analytics/qr-analytics#request-body):

<ParamField body="q" type="array" required>
  Identifiers to scope the export to — type depends on `filter_by`.
</ParamField>

<ParamField body="filter_by" type="string" default="qrid">
  `qrid`, `id`, `tags`, or `folder`.
</ParamField>

### Response formats

<Tabs>
  <Tab title="csv">
    Returns a **ZIP archive** (`application/zip`, `analytics.zip`) containing one CSV per metric type — not a single flat CSV. This is a real quirk of the export format: requesting `csv` gets you a zip, not a `.csv` file directly.
  </Tab>

  <Tab title="xls / xlsx">
    Returns a single spreadsheet (`analytics.xlsx`) with one sheet per metric type.
  </Tab>

  <Tab title="pdf">
    Returns a rendered PDF analytics report (`application/pdf`, `analytics.pdf`) — a formatted summary rather than raw per-metric sheets.
  </Tab>
</Tabs>

<Note>
  If the account has [event tracking](/api-reference/management-api/analytics/qr-analytics) analytics enabled, its `count`/`engagement` metrics are appended as additional sheets/files in the same export automatically — no extra parameter needed.
</Note>

<Warning>
  Despite the underlying error message suggesting "generate Analytics Export instead," this endpoint enforces the **exact same** QR-code-count/date-range volume cap as [QR analytics](/api-reference/management-api/analytics/qr-analytics#request) — all analytics endpoints share the same request-validation code path. If you hit the `400` under `q`, narrow `q` or the date range; switching to this endpoint alone won't avoid it.
</Warning>

## Related

* [QR analytics](/api-reference/management-api/analytics/qr-analytics) — the JSON equivalent of this export, scoped to metric types you choose.
* [Export raw analytics](/api-reference/management-api/analytics/export-raw) — export row-level scan records instead of these aggregated breakdowns.
* [Management API overview](/api-reference/management-api/overview) — the auth scheme and quota architecture this endpoint is part of.


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /analytics/qr/export/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    management.scanova.io (QR codes, folders, tags, leads, forms, analytics,
    plans, shared users & roles), plus the token-creation and usage-stats
    endpoints used to authenticate against it. Every path and request/response
    shape below was verified live against a real API key and the actual running
    backend (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://management.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /analytics/qr/export/:
    post:
      summary: Export analytics
      description: >-
        Exports aggregated analytics (every metric type the plan allows) as a
        downloadable file — csv (returned as a zip of per-metric CSVs),
        xls/xlsx, or pdf. POST-only; shares its request body and volume-cap
        validation with /analytics/qr/.
      operationId: exportManagedAnalytics
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: file_format
          in: query
          required: true
          schema:
            type: string
            enum:
              - csv
              - xls
              - xlsx
              - pdf
        - name: exclude_bot_scan
          in: query
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                q:
                  type: array
                  items:
                    type: string
                filter_by:
                  type: string
                  enum:
                    - qrid
                    - tags
                    - id
                    - folder
                  default: qrid
              required:
                - q
            example:
              q:
                - Q07afe81aa0034c01
              filter_by: qrid
      responses:
        '200':
          description: >-
            Binary file download — application/zip for csv, spreadsheet mimetype
            for xls/xlsx, application/pdf for pdf.
          content:
            application/zip: {}
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: {}
            application/pdf: {}
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. management.scanova.io) — the same key sent to
        the regular API host will not authenticate.

````