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

# 将潜在客户列表转换为表单

> POST /lead/{lead_id}/convert/

将一个旧版潜在客户列表迁移为[表单](/zh/api-reference/management-api/forms/create) —— Scanova 当前推荐使用的潜在客户捕获构建器。

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

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

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.scanova.io/lead/L9c2f4a1e/convert/' \
    --header 'Authorization: YOUR_API_KEY'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": 512,
    "form_id": "F3b9c1a2",
    "lead_id": "L9c2f4a1e"
  }
  ```
</ResponseExample>

转换潜在客户列表会：

* 根据潜在客户列表的字段定义创建一个新表单。
* 将当前附加到该潜在客户列表的每个 QR 码重新链接到新表单。
* 将有效的 webhook 迁移到表单的 webhook 机制（潜在客户列表自身的 webhook 会被标记为非活动）。
* 将为此潜在客户列表配置的任何潜在客户通知迁移为表单通知。
* 将潜在客户列表标记为 `is_converted: true` —— 从此刻起，它不再出现在[列出潜在客户列表](/zh/api-reference/management-api/leads/list)或[列出活跃的潜在客户列表](/zh/api-reference/management-api/leads/active-list)中，后续的编辑/条目/导出改为通过表单端点进行。

<Warning>
  此操作在幂等性方面并不友好：对已转换的潜在客户列表再次调用转换会返回 `404`，因为查找会过滤为未转换的列表。没有"撤销"功能 —— 请在重试之前检查 `is_converted`（通过[获取潜在客户列表](/zh/api-reference/management-api/leads/retrieve)，转换后该请求将返回 `404`）。
</Warning>

如果转换后的表单数据意外未通过表单架构验证（一种罕见的形状漂移边缘情况，格式良好的潜在客户列表通常不会触发），则在 `data` 下返回 `400`。

## 相关内容

* [列出潜在客户列表](/zh/api-reference/management-api/leads/list) —— 可转换的潜在客户列表。
* [表单管理](/zh/api-reference/management-api/forms/create) —— 转换后资源所在的位置。
* [管理 API 概述](/zh/api-reference/management-api/overview) —— 此端点所属的身份验证方案和配额体系。


## OpenAPI

````yaml api-reference/openapi/management-api.json POST /lead/{lead_id}/convert/
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}/convert/:
    post:
      summary: Convert a lead list to a Form
      operationId: convertManagedLeadList
      responses:
        '201':
          description: Converted.
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.

````