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

> Создайте новую сессию KYC для ключевого лица KYB, если предыдущая сессия была удалена или истекла до начала, и отправьте ему новую ссылку по email в Didit.



Промпт для API: регенерация сессии KYC для ключевых лиц
        Скопировать промпт в буфер обмена



      
      

\<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/ru/business-verification/response-schema.md#key_people_checks). Если человека вообще не нужно верифицировать, вместо этого [пропустите участника](https://docs.didit.me/ru/sessions-api/update-data.md#пропуск-стороны-key-people). О том, как устроены участники и их верификации, читайте в разделе [Ключевые лица](https://docs.didit.me/ru/business-verification/key-people.md).


## OpenAPI

````yaml ru/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_session_deleted: true`) или истекла до начала её прохождения
        (`Expired`, никогда не начиналась). Сессия, которая всё ещё выполняется
        или завершилась в любом другом статусе (`Approved`, `Declined`, `In
        Review`, `Abandoned`, ...), возвращает `409`, если только она не была
        удалена. Для стороны, у которой сессии никогда не было, или
        стороны-компании всегда возвращается `409`. Didit создаёт новую
        размещённую KYC-сессию со сценарием, с которым сторона проходила
        верификацию (его последней опубликованной версией), или, если он больше
        неизвестен, со сценарием, который ваши настройки ключевых лиц назначают
        роли стороны, поэтому срок действия её ссылки равен времени истечения
        сессии этого KYC-сценария; Didit отправляет ссылку стороне по
        электронной почте, если адрес электронной почты сохранён в системе,
        сбрасывает `is_skipped` и пересчитывает проверку ключевых лиц и статус
        сессии компании. Затем отправляется
        [webhook](https://docs.didit.me/ru/integration/webhooks) `data.updated`
        для сессии компании с триггером `console_key_people_regenerate`; чтобы
        вместо этого освободить сторону от проверки, используйте `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: UUID родительской сессии Верификации бизнеса (KYB).
          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: >-
            Ошибка аутентификации или авторизации. Отсутствующий ключ возвращает
            `403`, как и ключ другого приложения, ключ с ограниченной областью
            действия без необходимого для этого endpoint разрешения, а также
            запрос не из разрешённого списка IP-адресов ключа; неверный,
            отозванный или истекший ключ возвращает `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-адреса вне списка разрешённых 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: >-
            Превышен лимит запросов: 300 запросов на запись (POST, PATCH,
            DELETE) в минуту на один API-ключ. Подождите указанное в
            `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. `null`, если ссылка
            отсутствует или была удалена, а также для ограниченного API-ключа
            без права `sessions: write`.
        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-ключ вашего приложения из раздела «Разработчикам» -> «API-ключи» в
        Business Console. Основной ключ имеет полный доступ. Именованный ключ
        может иметь ограниченную область действия: без доступа, чтение или
        запись для каждого ресурса, ограничение определенными сценариями или
        одобренными сессиями, списком IP-адресов и сроком действия. 401
        означает, что ключ неверен, отозван или его срок действия истек; 403
        означает, что ключ не был передан, у ключа нет доступа к этому ресурсу
        или действию, либо запрос поступил с адреса вне его списка IP-адресов;
        404 на маршруте сессии означает, что сессия не входит в сценарии или
        статусы ключа. Ключ без доступа к медиа получает URL изображений, видео
        и PDF как null, а ключ без прав на запись сессий получает ссылки на
        сессии и токены как null. См. https://docs.didit.me/console/api-keys.

````

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