> ## 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 raw analytics

> POST /analytics/qr/raw/

Exports **raw, per-scan** analytics records — one row per scan event, rather than the aggregated breakdowns [QR analytics](/api-reference/management-api/analytics/qr-analytics) and [Export analytics](/api-reference/management-api/analytics/export) return.

<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_RAW` permission (distinct from the `ANALYTICS_CAN_EXPORT` permission the aggregated export requires — a role can have one without the other). 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/raw/?from=2026-07-01&to=2026-08-16&file_format=csv' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "q": ["Q07afe81aa0034c01"],
      "filter_by": "qrid"
    }' \
    --output raw-analytics.csv
  ```
</RequestExample>

This endpoint always returns a binary file, not JSON.

### 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`, or `xlsx`. Unlike [Export analytics](/api-reference/management-api/analytics/export), `pdf` is not a supported format here. Any other value (or omitting it) returns a `400` with `"Invalid file format"`.
</ParamField>

<ParamField query="type" type="string">
  Pass `raw_bot` to export only bot-identified scan records instead of all scans. Any other value is overwritten — this endpoint always exports raw data regardless of what you pass here.
</ParamField>

### Request body

Same shape as [QR analytics](/api-reference/management-api/analytics/qr-analytics#request-body) — `q` (required) and `filter_by` (default `qrid`) scope which QR codes' raw scans to include, and the same [QR-count/date-range volume cap](/api-reference/management-api/analytics/qr-analytics#request) applies.

<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 single CSV (`text/csv`, `analytics_raw.csv`) of raw scan rows.
  </Tab>

  <Tab title="xls / xlsx">
    Returns a spreadsheet (`analytics_raw.xlsx`) with raw scan rows, plus a separate sheet for event-tracking raw records if the account has event tracking enabled.
  </Tab>
</Tabs>

<Note>
  If the account has event tracking analytics enabled **and** `file_format` isn't `csv`, a second sheet/section of raw event-tracking records (session ID, timestamp, QR code ID/name, user-specified event tracking ID, URL hash, URL) is appended automatically. Requesting `csv` always returns scan records only — event-tracking rows are omitted for that format specifically.
</Note>

## Related

* [QR analytics](/api-reference/management-api/analytics/qr-analytics) — the aggregated, JSON equivalent of these raw scan records.
* [Export analytics](/api-reference/management-api/analytics/export) — export aggregated metric breakdowns instead of row-level scan data.
* [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/raw/
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/raw/:
    post:
      summary: Export raw analytics
      description: >-
        Exports raw, per-scan analytics records (one row per scan) as csv, xls,
        or xlsx (no pdf). POST-only; shares its request body and volume-cap
        validation with /analytics/qr/. Pass type=raw_bot as a query parameter
        to export bot-only scan records instead of all scans.
      operationId: exportManagedRawAnalytics
      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
        - name: type
          in: query
          schema:
            type: string
            enum:
              - raw_bot
          description: >-
            Pass raw_bot for a bot-only export; any other value is overwritten
            to raw.
      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 — text/csv for csv, spreadsheet mimetype for
            xls/xlsx.
          content:
            text/csv: {}
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: {}
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.

````