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

# 提交 KYB 关键人员 API

> 在 Didit 中声明 KYB 会话中已准备好的关键人员，并为每位需要验证的人员发起 KYC 验证。



## OpenAPI

````yaml zh/openapi-25.json POST /v3/session/{sessionId}/kyb/parties/submit/
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/submit/:
    post:
      tags:
        - Sessions
      summary: 提交 KYB 相关方草稿
      description: >-
        将已保存的草稿申报为公司的关键人员。这是在您 API 密钥下的托管关键人员步骤：Didit
        会根据工作流的角色设置和股权结构阈值判定必须验证哪些当事方，为他们每个人创建一个个人 KYC 会话（若为企业所有者则创建 KYB
        子会话），发送工作流要求的邮件，并推进该会话。每个子会话的计费方式与托管流程中相同。草稿在调用后即被消耗。提交成功后重复调用不会产生任何变更，并将返回
        `200` 以及 `already_submitted: true` 和已存在的当事方。会话必须处于关键人员步骤。将每个人的
        `kyc_session_url` 发送给他们，或将其嵌入。需要 `write:businesses` 权限。
      operationId: post_v3_session_kyb_parties_submit
      parameters:
        - name: sessionId
          in: path
          required: true
          description: 企业验证（KYB）会话的 UUID。它必须属于 API 密钥所属的应用。
          schema:
            type: string
            format: uuid
            example: 33333333-4444-5555-6666-777777777777
        - name: node_id
          in: query
          required: false
          description: KYB 步骤的工作流节点。仅在工作流具有多个 KYB 节点时需要；默认情况下，Didit 会使用会话自身的节点。
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                locale:
                  type: string
                  maxLength: 10
                  description: 用于翻译会话推进至的步骤响应的区域设置。
            example:
              locale: es
      responses:
        '200':
          description: 已声明（或此前已声明）的当事方。
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  next_step:
                    type: string
                    nullable: true
                    description: 会话当前所处的步骤。
                  status:
                    type: string
                    description: 企业会话的状态。
                  advanced:
                    type: boolean
                    description: 当此调用声明了相关方并推进了会话时为 `true`。
                  already_submitted:
                    type: boolean
                    description: 当相关方已在先前的调用中声明时为 `true`。
                  kyb_key_people_status:
                    type: string
                  parties:
                    type: array
                    items:
                      $ref: '#/components/schemas/KYBKeyPeopleParty'
              example:
                valid: true
                next_step: FINISHED
                status: In Progress
                advanced: true
                already_submitted: false
                kyb_key_people_status: In Progress
                parties: []
        '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.
        '402':
          description: 该组织已无可用额度用于子验证会话。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              example:
                detail: Insufficient credits.
        '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: 会话不存在、已被删除、属于另一个应用或超出了限定作用域密钥的限制；无法通过 detail 区分具体情况。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
              example:
                detail: Session not found.
        '409':
          description: >-
            `kyb_no_party_drafts`：没有可提交的内容。`kyb_parties_already_submitted`：在声明相关方后添加了草稿。`kyb_step_mismatch`：会话当前不处于关键人员步骤（`next_step`
            指明其所在步骤）。`kyb_session_not_writable`：会话已结束。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 便于人类阅读的错误消息。
                  code:
                    type: string
                  next_step:
                    type: string
              example:
                detail: There are no draft parties to submit.
                code: kyb_no_party_drafts
        '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: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.submit_kyb_parties(
                "33333333-4444-5555-6666-777777777777",
                locale="es",
            )
            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.submitKybParties("33333333-4444-5555-6666-777777777777",
            {
              locale: "es",
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.SubmitKYBParties(ctx, \"33333333-4444-5555-6666-777777777777\", didit.SessionsSubmitKYBPartiesParams{\n\tLocale: didit.String(\"es\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.SessionsSubmitKybPartiesParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().submitKybParties("33333333-4444-5555-6666-777777777777",
            SessionsSubmitKybPartiesParams.builder()
                    .locale("es")
                    .build());
            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->submitKybParties('33333333-4444-5555-6666-777777777777',
            [
                'locale' => 'es',
            ]);

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

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

            result = didit.sessions.submit_kyb_parties(
              "33333333-4444-5555-6666-777777777777",
              locale: "es"
            )
            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.SubmitKybPartiesAsync("33333333-4444-5555-6666-777777777777",
            new SessionsSubmitKybPartiesParams

            {
                Locale = "es",
            });

            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.