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

# Exportar analíticas de leads

> POST /lead/analytics/export/

Descarga analíticas de leads (los tres desgloses: recuentos de entradas, conversión y fuente) como archivo.

<Note>
  Requiere una clave de API de gestión con cuota `MANAGEMENT_API` (o `MANAGEMENT_API_SANDBOX`) y el permiso `LEAD_GENERATION_ANALYTICS_CAN_VIEW`, enviada como el valor sin procesar del encabezado `Authorization` — consulte el [resumen de la API de gestión](/es/api-reference/management-api/overview).
</Note>

<ParamField body="q" type="array" required>
  Igual que en [Obtener analíticas de leads](/es/api-reference/management-api/leads/analytics) — `lead_id`s o `url_hash`es de QR, según `filter_by`.
</ParamField>

<ParamField body="filter_by" type="string" default="lead_id">
  `lead_id` (predeterminado) o `qr_hash`.
</ParamField>

<ParamField query="file_format" type="string" default="csv">
  `csv` (un ZIP con un CSV por desglose), o `xls`/`xlsx` (un libro con tres hojas).
</ParamField>

<ParamField query="from" type="string">
  Fecha de inicio (`YYYY-MM-DD`). El valor predeterminado es 7 días antes de `to`.
</ParamField>

<ParamField query="to" type="string">
  Fecha de fin (`YYYY-MM-DD`). El valor predeterminado es hoy.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.scanova.io/lead/analytics/export/?file_format=xlsx&from=2026-08-01&to=2026-08-31' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{ "q": ["L9c2f4a1e"] }' \
    --output lead_analytics.xlsx
  ```
</RequestExample>

La respuesta es una descarga de archivo — `application/zip` con `Content-Disposition: attachment; filename=lead_analytics.zip` para `csv`, o el tipo MIME de XLSX con `filename=lead_analytics.xlsx` para `xls`/`xlsx`. A diferencia de [Obtener analíticas de leads](/es/api-reference/management-api/leads/analytics), no hay filtro `type` — la exportación siempre incluye los tres desgloses.

`400` con un cuerpo de texto sin formato si `file_format` no se reconoce:

```json 400 theme={null}
{ "detail": "Invalid file format" }
```

## Relacionado

* [Obtener analíticas de leads](/es/api-reference/management-api/leads/analytics) — el equivalente en JSON, con un filtro `type`.
* [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 /lead/analytics/export/
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:
  /lead/analytics/export/:
    post:
      summary: Export lead analytics
      operationId: exportManagedLeadAnalytics
      responses:
        '200':
          description: ZIP of CSVs or a multi-sheet XLSX file download.
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.

````