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

# 导出潜在客户条目

> GET /lead/{lead_id}/entry/export/

将潜在客户列表的条目下载为 CSV 或 Excel 文件。

<Note>
  需要具有 `MANAGEMENT_API`（或 `MANAGEMENT_API_SANDBOX`）配额和 `LEAD_GENERATION_ENTRY_CAN_VIEW` 权限的管理 API 密钥，作为原始 `Authorization` 标头值发送 —— 参见[管理 API 概述](/zh/api-reference/management-api/overview)。
</Note>

<ParamField path="lead_id" type="string" required>
  潜在客户列表的 `lead_id`。
</ParamField>

<ParamField query="file_format" type="string" default="csv">
  `csv`、`xls` 或 `xlsx`。
</ParamField>

<ParamField query="from" type="string">
  仅包含在此日期（含）之后创建的条目（`YYYY-MM-DD`）。
</ParamField>

<ParamField query="to" type="string">
  仅包含在此日期（含）之前创建的条目（`YYYY-MM-DD`）。
</ParamField>

<ParamField query="ids" type="string">
  以逗号分隔的条目 UUID，用于将导出范围限定为特定选择 —— 对应仪表板的"下载所选项"操作。无效的 UUID 会被静默忽略而非报错。
</ParamField>

<ParamField query="search" type="string">
  与[列出潜在客户条目](/zh/api-reference/management-api/leads/entry-list)相同的子字符串搜索 —— 对应"下载筛选结果"。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.scanova.io/lead/L9c2f4a1e/entry/export/?file_format=csv&from=2026-08-01&to=2026-08-31' \
    --header 'Authorization: YOUR_API_KEY' \
    --output entries.csv
  ```
</RequestExample>

响应是文件下载（`Content-Type: text/csv`，或 `xls`/`xlsx` 对应的 XLSX MIME 类型），而非 JSON，带有 `Content-Disposition: attachment; filename=<LeadListName>-<timestamp>.<ext>`。

<Note>
  无论账户其他位置的追踪权限如何，导出文件始终包含 `tracking_id` 列。如果提交所用的 QR 码此后已被删除，其列值会渲染为 `<qrid> (Deleted)`，而不会导致导出失败。当没有匹配的条目时，文件仍会包含一个表头行（源自潜在客户表单自身的问题标签），而不是为空。
</Note>

<Warning>
  在免费计划账户（`plan_type` 1）上，导出限制为 25 行 —— 如果匹配的条目超过此数，会在末尾附加两行说明达到限制并建议升级。
</Warning>

如果 `file_format` 不是 `csv`、`xls` 或 `xlsx` 之一，则返回带纯文本正文（而非标准 DRF 错误格式）的 `400`：

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

## 相关内容

* [列出潜在客户条目](/zh/api-reference/management-api/leads/entry-list) —— 具有相同筛选条件的 JSON 等效端点。
* [管理 API 概述](/zh/api-reference/management-api/overview) —— 此端点所属的身份验证方案和配额体系。


## OpenAPI

````yaml api-reference/openapi/management-api.json GET /lead/{lead_id}/entry/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/{lead_id}/entry/export/:
    get:
      summary: Export lead entries
      operationId: exportManagedLeadEntries
      responses:
        '200':
          description: CSV or 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.

````