> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 重新生成关键人员 KYC 会话 API

> 为 KYB 关键人员重新创建 KYC 会话。其原会话在开始前已被删除或过期，将向其发送新链接。Didit 提供此 API。



重新生成关键人员 KYC 会话 API 提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Give a Key People party of a Didit Business Verification (KYB) session a new individual KYC session through the API.

Endpoint:
POST https://verification.didit.me/v3/session/{session_id}/kyb/parties/{party_uuid}/regenerate/
(no request body)

Authentication:
Send my Didit API key in the x-api-key header. A scoped key needs decisions: write.

Goal:
\- Re-verify a person (UBO, director, other key person) whose individual KYC session was deleted, or expired before the person started it. Neither link lets the person complete verification. An expired child can cause the business session to become Declined; regenerate the party to issue a fresh link.

Behavior:
\- {session_id} is the parent business session; {party_uuid} is key_people_checks[].submitted.parties[].uuid from its decision and must belong to that session.
\- Works when the party's KYC session was deleted (kyc_session_deleted: true) or expired before the person started it. A session still in progress or one that ended in another status (Approved, Declined, In Review, Abandoned...) returns 409 unless it was deleted. A party that never had one or a company party always returns 409.
\- Deleted sessions qualify even if the person had already started or finished verification. Imported sessions do not qualify through expiry; they must have been deleted.
\- Didit creates a new hosted KYC session for the person, with the workflow the party was verified with (its latest published version) or, when that is no longer known, the workflow my Key People settings assign to the person's role. The new link lasts that KYC workflow's session expiration time, not the business session's. Its vendor_data is kyb-party-PARTY_UUID.
\- Didit emails the verification link to the party's email, when there is one.
\- is_skipped is cleared, so the Key People check waits on the new session.
\- The Key People check and the business session status are recomputed at once.
\- A data.updated webhook is sent for the business session with trigger "console_key_people_regenerate".
\- To exempt the party instead of re-verifying them, use PATCH /v3/session/{session_id}/kyb/parties/{party_uuid}/ with {"is_skipped": true}.

Example call:
curl -X POST "https://verification.didit.me/v3/session/33333333-4444-5555-6666-777777777777/kyb/parties/0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41/regenerate/" \
-H "x-api-key: YOUR_API_KEY"

What to read from the response (the updated party):
\- kyc_session_id: the new KYC session.
\- kyc_session_url: its hosted link, to share yourself if the party has no email. A scoped key without sessions: write receives it as null.
\- kyc_session_status (Not Started), kyc_session_deleted (false), is_skipped (false).

Failure modes:
\- 401: the API key has expired.
\- 403: missing key (a wrong, revoked or expired key gets 401), a key of another application, a scoped key without decisions: write, or a request from outside the key's IP allowlist.
\- 404: the session does not exist, was deleted, or is outside a scoped key's limits; no party has this UUID; or the party belongs to another session.
\- 409 with code kyb_party_kyc_session_not_deleted: no eligible KYC session to replace. A person qualifies only when their session was deleted or a non-imported session expired before the person started it. All other sessions, a party that never had one, and company parties are rejected.

Side effects: creates a KYC session, may send an email to the party, recomputes the business session status and sends a data.updated webhook.

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

粘贴到

在上一个链接失效时使用此方法：会话已被删除，或在该人员开始之前已过期。即使该人员已开始或完成验证，已删除的会话同样符合条件。导入的会话不因过期而符合条件，必须已被删除。未被删除且该人员已开始的会话，不能因过期而符合条件。新会话关联到同一参与方，因此其结果会像原会话那样进入关键人员检查。其链接的有效期为所运行 KYC 工作流的会话有效期（1 小时至 4 周），而非企业会话的有效期。请在[企业会话决策](https://docs.didit.me/zh/business-verification/response-schema.md#key_people_checks)中查看参与方及其子会话。如果该人员完全不需要验证，请改为[跳过该参与方](https://docs.didit.me/zh/sessions-api/update-data.md#跳过关键人员)。如需了解参与方及其验证的运作方式，请参阅[关键人员](https://docs.didit.me/zh/business-verification/key-people.md)。


## OpenAPI

````yaml zh/openapi-25.json POST /v3/session/{sessionId}/kyb/parties/{partyUuid}/regenerate/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/kyb/parties/{partyUuid}/regenerate/:
    post:
      tags:
        - Sessions
      summary: 重新生成关键人员方的 KYC 会话
      description: >-
        在企业验证（KYB）会话的关键人员关联方先前的个人 KYC 会话被删除或在该人员开始之前已过期后，为其赋予一个新的个人 KYC
        会话，以便重新完成关键人员检查；无需发送请求体。当该关联方的 KYC 会话已被删除（`kyc_session_deleted:
        true`）或在该人员开始之前已过期（`Expired`，从未开始）时有效。仍在进行中或以任何其他状态结束（`Approved`、`Declined`、`In
        Review`、`Abandoned` 等）的会话将返回 `409`，除非它已被删除。从未拥有过会话的关联方或企业关联方始终返回
        `409`。Didit 会使用验证该关联方时所用的工作流（其最新发布版本）创建新的托管 KYC
        会话，若该工作流不再可知，则使用您的关键人员设置分配给该关联方角色的工作流，因此其链接的有效时长即为该 KYC
        工作流的会话过期时间；如果有电子邮箱记录，Didit 会通过电子邮件将链接发送给该关联方，清除
        `is_skipped`，并重新计算关键人员检查及企业会话状态。随后，Didit 会针对企业会话发送触发器为
        `console_key_people_regenerate` 的 `data.updated`
        [Webhook](https://docs.didit.me/zh/integration/webhooks)；若要豁免该关联方，请改用
        `PATCH /v3/session/{sessionId}/kyb/parties/{partyUuid}/`。作用域限制的 API 密钥需要
        `decisions: write` 权限，若缺少 `sessions: write` 权限，其接收到的 `kyc_session_url`
        将为 `null`。即使该人员已经开始或完成了验证，已被删除的会话仍符合条件。导入的会话不会因过期而符合条件；它们必须已被删除。
      operationId: post_v3_session_kyb_party_regenerate
      parameters:
        - name: sessionId
          in: path
          required: true
          description: 父企业验证（KYB）会话的 UUID。
          schema:
            type: string
            format: uuid
            example: 33333333-4444-5555-6666-777777777777
        - name: partyUuid
          in: path
          required: true
          description: >-
            关键人员主体的 UUID（企业会话决策上的
            `key_people_checks[].submitted.parties[].uuid`）。必须属于 `sessionId`
            所引用的会话。
          schema:
            type: string
            format: uuid
            example: 0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41
      responses:
        '200':
          description: 已创建新的 KYC 会话。返回包含新子会话的更新后当事方，该子会话将在其 KYC 工作流的会话过期时间后过期。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KYBKeyPeopleParty'
              example:
                uuid: 0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41
                entity_type: person
                source: USER
                name: Jane Smith
                first_name: Jane
                last_name: Smith
                company_name: null
                registration_number: null
                email: user@example.com
                nationality: GB
                phone_number: null
                date_of_birth: '1980-05-04'
                position: Director
                custom_fields: {}
                is_active: true
                is_skipped: false
                requires_verification: true
                roles:
                  - role: director
                    ownership_percent: null
                    voting_percent: null
                kyc_session_id: 55555555-6666-7777-8888-999999999999
                kyc_session_status: Not Started
                kyc_session_url: https://verify.didit.me/session/abc123def456
                kyc_session_deleted: false
                kyb_sub_session_id: null
                kyb_sub_session_status: null
                kyb_sub_session_url: null
                kyb_sub_session_deleted: false
                verification_workflow_type: kyc
                verification_workflow_id: 12121212-3434-5656-7878-909090909090
                verification_workflow_label: Key People KYC
                verification_workflow_features:
                  - feature: ID_VERIFICATION
                    status: Not Finished
                  - feature: LIVENESS
                    status: Not Finished
                  - feature: AML
                    status: Not Finished
                didit_internal_id: null
        '401':
          description: 作用域 API 密钥已过期。这是唯一返回 `401` 的情况：缺失、无效或已吊销的密钥将返回 `403`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Expired key:
                  summary: 密钥的到期日期已过
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            身份验证或授权失败。缺少密钥，以及属于其他应用的密钥、缺少该 endpoint 所需权限的限定作用域密钥和来自该密钥 IP
            允许名单之外的请求均返回 `403`；错误、已撤销或已过期的密钥返回 `401`。可通过 `detail` 区分它们。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Missing or invalid credentials:
                  summary: 缺少 x-api-key 请求头，或该密钥验证失败
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: 属于与该会话不同应用的有效密钥
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without decisions write:
                  summary: '作用域密钥缺少 decisions: write 权限'
                  value:
                    detail: This API key has no write access to decisions.
                IP not allowed:
                  summary: 来自密钥 IP 白名单之外的请求
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            会话不存在、已被删除或超出了限定作用域密钥的限制；您的应用中不存在具有此 UUID
            的主体；或者该主体属于另一个会话。每种情况都有其独立的 `detail`。会话查找在凭证检查之前执行，因此即使没有有效密钥，未知的
            `sessionId` 也会返回 `404`。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Unknown session:
                  summary: 不存在具有此 ID 的会话，或该会话已被删除
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: 会话超出了限定作用域密钥的工作流或仅限已通过状态的限制
                  value:
                    detail: Session not found.
                Unknown party:
                  summary: 您的应用中没有具有此 UUID 的主体
                  value:
                    detail: No BusinessParty matches the given query.
                Party of another session:
                  summary: partyUuid 存在，但属于其他会话
                  value:
                    detail: Party does not belong to the given session.
        '409':
          description: >-
            该主体没有可供替换的有效 KYC 会话。除非已被删除，否则仍在进行中或以其他状态（`Approved`、`Declined`、`In
            Review`、`Abandoned`……）结束的会话均无法重新生成。从未有过会话的主体或企业主体同样会返回
            `409`。有效会话是指在该人员启动前已被删除或已过期的会话。即使该人员已经开始或完成验证，已删除的会话仍然符合条件。导入的会话不能仅通过过期来获得资格；它们必须已被删除。根据
            `code` 进行分支处理。
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                  - code
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
                  code:
                    type: string
                    enum:
                      - kyb_party_kyc_session_not_deleted
                    description: 稳定的机器可读错误代码。
              example:
                detail: >-
                  This party's KYC session is still live (it has neither been
                  deleted nor expired without starting), so it cannot be
                  regenerated.
                code: kyb_party_kyc_session_not_deleted
        '429':
          description: >-
            超出速率限制：每个 API 密钥每分钟 300 次写入（POST、PATCH、DELETE）请求。请等待 `Retry-After`
            秒后再重试；`X-RateLimit-*` 响应头显示了额度。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              examples:
                Rate limited:
                  summary: 当前分钟的预算已耗尽
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
          headers:
            Retry-After:
              description: 重试前需要等待的秒数。
              schema:
                type: integer
                minimum: 1
                example: 30
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/session/33333333-4444-5555-6666-777777777777/kyb/parties/0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41/regenerate/'
            \
              -H 'x-api-key: YOUR_API_KEY'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.regenerate_kyb_party(
                "33333333-4444-5555-6666-777777777777",
                "0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.sessions.regenerateKybParty(
              "33333333-4444-5555-6666-777777777777",
              "0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41",
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.RegenerateKYBParty(ctx, \"33333333-4444-5555-6666-777777777777\", \"0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().regenerateKybParty("33333333-4444-5555-6666-777777777777",
            "0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41");

            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->sessions->regenerateKybParty('33333333-4444-5555-6666-777777777777',
            '0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41');

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.sessions.regenerate_kyb_party(
              "33333333-4444-5555-6666-777777777777",
              "0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Sessions.RegenerateKybPartyAsync("33333333-4444-5555-6666-777777777777",
            "0a3f1e2c-7c2f-4a1b-9d55-2f8d2a5d6b41");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    KYBKeyPeopleParty:
      type: object
      description: >-
        企业验证（KYB）会话的关键人员关联方及其子验证。同一关联方会出现在企业会话决策的
        `key_people_checks[].submitted.parties[]` 中。
      required:
        - uuid
        - entity_type
        - source
        - name
        - is_active
        - is_skipped
        - requires_verification
        - roles
        - kyc_session_deleted
        - kyb_sub_session_deleted
      properties:
        uuid:
          type: string
          format: uuid
          description: 当事方标识符。
        entity_type:
          type: string
          enum:
            - person
            - company
          description: 该主体是个人还是公司。
        source:
          type: string
          enum:
            - REGISTRY
            - USER
          description: '`REGISTRY`：从公司登记获取。`USER`：在关键人员页面中输入。'
        name:
          type: string
          description: 参与方的显示名称。
        first_name:
          type: string
          nullable: true
          description: 名（个人）。
        last_name:
          type: string
          nullable: true
          description: 姓氏（自然人）。
        company_name:
          type: string
          nullable: true
          description: 企业名称（企业主体）。
        registration_number:
          type: string
          nullable: true
          description: 企业注册号（企业主体）。
        email:
          type: string
          format: email
          nullable: true
          description: 验证链接发送至的邮箱。
        nationality:
          type: string
          nullable: true
          description: 个人为国籍，企业为注册成立国家/地区。
        phone_number:
          type: string
          nullable: true
          description: 为该主体采集的电话号码。
        date_of_birth:
          type: string
          format: date
          nullable: true
          description: 出生日期（自然人）。
        position:
          type: string
          nullable: true
          description: 自由文本职位（个人）。
        custom_fields:
          type: object
          additionalProperties: true
          description: 为该方收集的工作流定义自定义字段，按字段键索引。
        is_active:
          type: boolean
          description: 该主体是否处于活跃状态。
        is_skipped:
          type: boolean
          description: 该主体是否免于验证。重新生成将清除此状态。
        requires_verification:
          type: boolean
          description: 角色和股权结构规则是否要求对此主体进行验证。
        roles:
          type: array
          description: 当事方在公司中担任的角色。
          items:
            type: object
            required:
              - role
              - ownership_percent
              - voting_percent
            properties:
              role:
                type: string
                enum:
                  - director
                  - non_executive_director
                  - secretary
                  - chairman
                  - ubo
                  - shareholder
                  - representative
                  - founder
                  - legal_advisor
                  - authorized_signatory
                  - trustee
                  - beneficiary
                  - settlor
                  - protector
                  - company_officer
                  - investor
                  - other
                description: 角色代码。
              ownership_percent:
                type: number
                nullable: true
                description: 该角色的持股比例（如已知）。
              voting_percent:
                type: number
                nullable: true
                description: 该角色的投票权百分比（若已知）。
        kyc_session_id:
          type: string
          format: uuid
          nullable: true
          description: 子个人 KYC 会话（个人）。
        kyc_session_status:
          type: string
          nullable: true
          enum:
            - Not Started
            - In Progress
            - Approved
            - Declined
            - In Review
            - Expired
            - Abandoned
            - Kyc Expired
            - Resubmitted
            - Awaiting User
            - null
          description: 子 KYC 会话的状态。已删除的会话保留其被删除时的状态。
        kyc_session_url:
          type: string
          format: uri
          nullable: true
          description: >-
            子 KYC 会话的托管链接。在没有子会话、子会话已被删除，以及对于不具备 `sessions: write` 作用域的受限 API
            密钥时为 `null`。
        kyc_session_deleted:
          type: boolean
          description: 子 KYC 会话已被删除，因此永远无法完成结算。
        kyb_sub_session_id:
          type: string
          format: uuid
          nullable: true
          description: 子 KYB 会话（企业各方）。
        kyb_sub_session_status:
          type: string
          nullable: true
          enum:
            - Not Started
            - In Progress
            - Approved
            - Declined
            - In Review
            - Expired
            - Abandoned
            - Kyc Expired
            - Resubmitted
            - Awaiting User
            - null
          description: 子 KYB 会话的状态。
        kyb_sub_session_url:
          type: string
          format: uri
          nullable: true
          description: 子 KYB 会话的托管链接，其 `null` 规则与 `kyc_session_url` 相同。
        kyb_sub_session_deleted:
          type: boolean
          description: 对应企业主体的 `kyc_session_deleted`。
        verification_workflow_type:
          type: string
          nullable: true
          enum:
            - kyc
            - kyb
            - adaptive_age_verification
            - biometric_authentication
            - address_verification
            - questionnaire_verification
            - email_verification
            - phone_verification
            - null
          description: 子会话运行的工作流类型。
        verification_workflow_id:
          type: string
          format: uuid
          nullable: true
          description: 子会话运行的工作流。
        verification_workflow_label:
          type: string
          nullable: true
          description: 该工作流的标签。
        verification_workflow_features:
          type: array
          nullable: true
          description: 子会话工作流的功能及其当前状态。
          items:
            type: object
            required:
              - feature
              - status
            properties:
              feature:
                type: string
                description: 功能代码，例如 `ID_VERIFICATION` 或 `LIVENESS`。
              status:
                type: string
                description: 功能状态，运行前为 `Not Finished`。
        didit_internal_id:
          type: string
          format: uuid
          nullable: true
          description: 已验证人员的 Didit 标识符（一旦获知）。
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.