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

# Generar un informe de analíticas

> POST /analytics/report/

Encola un trabajo asíncrono que genera un informe de datos de escaneo y/o analíticas que abarca un conjunto de códigos QR, una etiqueta o una carpeta.

<Note>
  Requiere una clave de API de gestión con cuota `MANAGEMENT_API` (o `MANAGEMENT_API_SANDBOX`) — consulte el [resumen de la API de gestión](/es/api-reference/management-api/overview) — más la cuota `EXPORT_ANALYTICS_REPORT` y el permiso `ANALYTICS_CAN_EXPORT_REPORT` propios de la cuenta.
</Note>

<ParamField body="filter_type" type="string" required>
  Qué identifica `filter_data`: `qrcode`, `tag` o `folder`.
</ParamField>

<ParamField body="filter_data" type="string" required>
  Una cadena codificada en JSON que identifica el/los objetivo(s) — p. ej. un array JSON de `qrid`s cuando `filter_type` es `qrcode`.
</ParamField>

<ParamField body="start_date" type="string" required>
  Fecha de inicio (`YYYY-MM-DD`).
</ParamField>

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

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

<ParamField body="analytics_format" type="string" default="csv">
  Formato de archivo para la parte de analíticas: `csv`, `xls`, `xlsx`, `png`, `jpeg` o `pdf`.
</ParamField>

<ParamField body="scan_format" type="string" default="csv">
  Formato de archivo para la parte de datos de escaneo: las mismas opciones que `analytics_format`.
</ParamField>

<ParamField body="advance_filter" type="object">
  Payload JSON de filtro adicional opcional, superpuesto a `filter_type`/`filter_data`.
</ParamField>

<ParamField body="exclude_bot_scan" type="boolean" default="false">
  Excluye del informe los escaneos identificados como tráfico de bots.
</ParamField>

<ParamField body="is_saved" type="boolean" default="false">
  Si se debe conservar este informe como una configuración predefinida reutilizable — consulte [Actualizar un informe de analíticas guardado](/es/api-reference/management-api/analytics/report-update).
</ParamField>

<ParamField body="saved_name" type="string">
  Un nombre para la configuración predefinida guardada, requerido si `is_saved` es `true`. Debe ser único por cuenta — un duplicado devuelve `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>

La llamada devuelve `201` inmediatamente una vez que el trabajo está en cola, con `status: "new"` — el informe en sí se genera en segundo plano y la cuenta recibe un correo electrónico al completarse. Consulte [Listar informes de analíticas](/es/api-reference/management-api/analytics/report-list) para conocer `status` y `report_file`.

## Relacionado

* [Listar informes de analíticas](/es/api-reference/management-api/analytics/report-list) — consultar el estado del trabajo.
* [Actualizar un informe de analíticas guardado](/es/api-reference/management-api/analytics/report-update) — renombrar o gestionar una configuración predefinida guardada.
* [Resumen de la API de gestión](/es/api-reference/management-api/overview) — el esquema de autenticación y la arquitectura de cuotas a la que pertenece este 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: 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. api.scanova.io) — the same key sent to the
        regular API host will not authenticate.

````