> ## 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.

# Générer un rapport d'analyses

> POST /analytics/report/

Met en file d'attente une tâche asynchrone qui génère un rapport de données de scan et/ou d'analyses couvrant un ensemble de codes QR, une étiquette ou un dossier.

<Note>
  Nécessite une clé d'API de gestion avec le quota `MANAGEMENT_API` (ou `MANAGEMENT_API_SANDBOX`) — voir la [présentation de l'API de gestion](/fr/api-reference/management-api/overview) — plus le quota `EXPORT_ANALYTICS_REPORT` et la permission `ANALYTICS_CAN_EXPORT_REPORT` propres au compte.
</Note>

<ParamField body="filter_type" type="string" required>
  Ce que `filter_data` identifie : `qrcode`, `tag` ou `folder`.
</ParamField>

<ParamField body="filter_data" type="string" required>
  Une chaîne encodée en JSON identifiant la ou les cible(s) — par ex. un tableau JSON de `qrid` lorsque `filter_type` vaut `qrcode`.
</ParamField>

<ParamField body="start_date" type="string" required>
  Date de début (`YYYY-MM-DD`).
</ParamField>

<ParamField body="end_date" type="string" required>
  Date de fin (`YYYY-MM-DD`).
</ParamField>

<ParamField body="report_type" type="string" default="both">
  `scan_data`, `analytics` ou `both`.
</ParamField>

<ParamField body="analytics_format" type="string" default="csv">
  Format de fichier pour la partie analyses : `csv`, `xls`, `xlsx`, `png`, `jpeg` ou `pdf`.
</ParamField>

<ParamField body="scan_format" type="string" default="csv">
  Format de fichier pour la partie données de scan : mêmes options que `analytics_format`.
</ParamField>

<ParamField body="advance_filter" type="object">
  Charge JSON de filtre supplémentaire optionnelle, superposée à `filter_type`/`filter_data`.
</ParamField>

<ParamField body="exclude_bot_scan" type="boolean" default="false">
  Exclut du rapport les scans identifiés comme trafic de bots.
</ParamField>

<ParamField body="is_saved" type="boolean" default="false">
  Indique s'il faut conserver ce rapport comme préréglage réutilisable enregistré — voir [Mettre à jour un rapport d'analyses enregistré](/fr/api-reference/management-api/analytics/report-update).
</ParamField>

<ParamField body="saved_name" type="string">
  Un nom pour le préréglage enregistré, requis si `is_saved` vaut `true`. Doit être unique par compte — un doublon renvoie `400`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.scanova.io/analytics/report/' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "filter_type": "qrcode",
      "filter_data": "[\"Q07afe81aa0034c01\"]",
      "start_date": "2026-08-01",
      "end_date": "2026-08-31",
      "report_type": "both",
      "analytics_format": "xlsx",
      "scan_format": "csv"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": 59,
    "filter_type": "qrcode",
    "filter_data": "[\"Q07afe81aa0034c01\"]",
    "start_date": "2026-08-01",
    "end_date": "2026-08-31",
    "report_type": "both",
    "analytics_format": "xlsx",
    "scan_format": "csv",
    "status": "new",
    "report_file": null,
    "completed_on": null,
    "is_saved": false,
    "saved_name": null,
    "created": "2026-09-08T10:20:00Z",
    "requested_by_name": "Docs"
  }
  ```
</ResponseExample>

L'appel renvoie `201` immédiatement une fois la tâche mise en file d'attente, avec `status: "new"` — le rapport lui-même est généré en arrière-plan et le compte reçoit un e-mail à la fin. Interrogez [Lister les rapports d'analyses](/fr/api-reference/management-api/analytics/report-list) pour connaître `status` et `report_file`.

## Voir aussi

* [Lister les rapports d'analyses](/fr/api-reference/management-api/analytics/report-list) — interroger le statut de la tâche.
* [Mettre à jour un rapport d'analyses enregistré](/fr/api-reference/management-api/analytics/report-update) — renommer ou gérer un préréglage enregistré.
* [Présentation de l'API de gestion](/fr/api-reference/management-api/overview) — le schéma d'authentification et l'architecture de quotas dont fait partie cet endpoint.


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /analytics/report/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    api.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://api.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /analytics/report/:
    post:
      summary: Generate an analytics report
      description: >-
        Queues an async job that generates a scan-data and/or analytics report
        for the given QR codes, tags, or folders. Returns immediately — poll
        [List analytics
        reports](/api-reference/management-api/analytics/report-list) for
        `status`.
      operationId: createAnalyticsReport
      requestBody:
        content:
          application/json:
            example:
              filter_type: qrcode
              filter_data: '["Q07afe81aa0034c01"]'
              start_date: '2026-08-01'
              end_date: '2026-08-31'
              report_type: both
              analytics_format: xlsx
              scan_format: csv
      responses:
        '201':
          description: Report job queued.
          content:
            application/json:
              example:
                id: 59
                filter_type: qrcode
                filter_data: '["Q07afe81aa0034c01"]'
                start_date: '2026-08-01'
                end_date: '2026-08-31'
                report_type: both
                analytics_format: xlsx
                scan_format: csv
                status: new
                report_file: null
                completed_on: null
                is_saved: false
                saved_name: null
                created: '2026-09-08T10:20:00Z'
                requested_by_name: Docs
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: YOUR_API_KEY`. 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.
        api.scanova.io) — the same key sent to the regular API host will not
        authenticate.

````