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

# Edit KYB Party Draft API

> Change the fields of one key person draft of a KYB session; the merged party is validated as a whole.



## OpenAPI

````yaml PATCH /v3/session/{sessionId}/kyb/parties/drafts/{draftId}/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: Identity verification API. Authenticate with x-api-key header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/kyb/parties/drafts/{draftId}/:
    patch:
      tags:
        - Sessions
      summary: Edit a KYB party draft
      description: >-
        Change fields of one party draft. The edit is merged into the stored
        draft and the merged party is validated as a whole, so an edit that
        would leave the party incomplete is rejected. Changing `first_name` or
        `last_name` replaces the stored full name. Requires `write:businesses`.
      operationId: patch_v3_session_kyb_party_draft
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            UUID of the Business Verification (KYB) session. It must belong to
            the application of the API key.
          schema:
            type: string
            format: uuid
            example: 33333333-4444-5555-6666-777777777777
        - name: draftId
          in: path
          required: true
          description: UUID of the party draft (`draft_id` returned when it was created).
          schema:
            type: string
            format: uuid
            example: 5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d
        - name: node_id
          in: query
          required: false
          description: >-
            Workflow node of the KYB step. Only needed when the workflow has
            more than one KYB node; by default Didit uses the session's own
            node.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                Any subset of the party fields. The edit is merged into the
                stored draft and the merged party is validated as a whole, so a
                draft that could be submitted before an edit can still be
                submitted after it.
              properties:
                entity_type:
                  type: string
                  enum:
                    - person
                    - company
                  description: Whether the party is an individual or a company.
                full_name:
                  type: string
                  maxLength: 255
                  description: >-
                    Full name of a person. Send it, or `first_name` and
                    `last_name`.
                first_name:
                  type: string
                  maxLength: 128
                last_name:
                  type: string
                  maxLength: 128
                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: >-
                    Role the party holds. Interchangeable with `roles`; when
                    both are sent they are merged.
                roles:
                  type: array
                  items:
                    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: >-
                    Every role the party holds. A person needs at least one role
                    (here or in `role`).
                position:
                  type: string
                  maxLength: 128
                  description: Job title of a person.
                date_of_birth:
                  type: string
                  format: date
                  nullable: true
                company_name:
                  type: string
                  maxLength: 255
                  description: >-
                    Name of a company party. Required when `entity_type` is
                    `company`.
                registration_number:
                  type: string
                  maxLength: 100
                  description: Registration number of a company party.
                email:
                  type: string
                  format: email
                  description: >-
                    Where the verification link is sent. Required when the party
                    has to complete verification, which depends on the role
                    settings and ownership thresholds of the workflow.
                ownership_percent:
                  type: number
                  nullable: true
                  description: Share of the company the party owns.
                nationality:
                  type: string
                  maxLength: 100
                  description: >-
                    Nationality of a person, or country of incorporation of a
                    company. Required for every party.
                phone_number:
                  type: string
                  maxLength: 32
                custom_fields:
                  type: object
                  additionalProperties: true
                  description: Workflow-defined extra fields.
                skip_verification:
                  type: boolean
                  default: false
                  description: >-
                    Ask to skip this party's verification. Honoured only when
                    the party's role allows skipping in the workflow's Key
                    People settings.
            example:
              ownership_percent: 55
      responses:
        '200':
          description: Draft updated.
          content:
            application/json:
              schema:
                type: object
                required:
                  - draft_id
                  - created_at
                  - updated_at
                  - party
                properties:
                  draft_id:
                    type: string
                    format: uuid
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                  party:
                    type: object
                    required:
                      - entity_type
                      - nationality
                    properties:
                      entity_type:
                        type: string
                        enum:
                          - person
                          - company
                        description: Whether the party is an individual or a company.
                      full_name:
                        type: string
                        maxLength: 255
                        description: >-
                          Full name of a person. Send it, or `first_name` and
                          `last_name`.
                      first_name:
                        type: string
                        maxLength: 128
                      last_name:
                        type: string
                        maxLength: 128
                      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: >-
                          Role the party holds. Interchangeable with `roles`;
                          when both are sent they are merged.
                      roles:
                        type: array
                        items:
                          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: >-
                          Every role the party holds. A person needs at least
                          one role (here or in `role`).
                      position:
                        type: string
                        maxLength: 128
                        description: Job title of a person.
                      date_of_birth:
                        type: string
                        format: date
                        nullable: true
                      company_name:
                        type: string
                        maxLength: 255
                        description: >-
                          Name of a company party. Required when `entity_type`
                          is `company`.
                      registration_number:
                        type: string
                        maxLength: 100
                        description: Registration number of a company party.
                      email:
                        type: string
                        format: email
                        description: >-
                          Where the verification link is sent. Required when the
                          party has to complete verification, which depends on
                          the role settings and ownership thresholds of the
                          workflow.
                      ownership_percent:
                        type: number
                        nullable: true
                        description: Share of the company the party owns.
                      nationality:
                        type: string
                        maxLength: 100
                        description: >-
                          Nationality of a person, or country of incorporation
                          of a company. Required for every party.
                      phone_number:
                        type: string
                        maxLength: 32
                      custom_fields:
                        type: object
                        additionalProperties: true
                        description: Workflow-defined extra fields.
                      skip_verification:
                        type: boolean
                        default: false
                        description: >-
                          Ask to skip this party's verification. Honoured only
                          when the party's role allows skipping in the
                          workflow's Key People settings.
              example:
                draft_id: 5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d
                created_at: '2026-10-31T10:00:00Z'
                updated_at: '2026-10-31T10:00:00Z'
                party:
                  entity_type: person
                  first_name: Ana
                  last_name: Lopez
                  roles:
                    - ubo
                    - director
                  ownership_percent: 55
                  nationality: MEX
                  email: ana.lopez@example.com
                  date_of_birth: '1984-06-12'
        '400':
          description: The merged party is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
              example:
                non_field_errors:
                  - Person parties require at least one role.
        '401':
          description: >-
            The scoped API key has expired. This is the only case that returns
            `401`: a missing, invalid or revoked key returns `403`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
              examples:
                Expired key:
                  summary: The key's expiry date has passed
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            Authentication or authorization failure. Missing, invalid and
            revoked keys return `403` (not `401`); so do a key of another
            application, a scoped key without the permission this endpoint
            needs, and a request from outside the key's IP allowlist.
            Distinguish them by `detail`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
              examples:
                Missing or invalid credentials:
                  summary: No x-api-key header, or the key failed validation
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: >-
                    A valid key that belongs to a different application than the
                    session
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without decisions write:
                  summary: 'Scoped key lacks decisions: write'
                  value:
                    detail: This API key has no write access to decisions.
                IP not allowed:
                  summary: Request from outside the key's IP allowlist
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            The session or the draft does not exist, or the session is outside
            the key's application or a scoped key's limits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
              example:
                detail: Session not found.
        '409':
          description: The session is finished (`kyb_session_not_writable`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
                  code:
                    type: string
              example:
                detail: This verification session is no longer accepting changes.
                code: kyb_session_not_writable
        '429':
          description: >-
            Rate limit exceeded: 300 write (POST, PATCH, DELETE) requests per
            minute per API key. Wait `Retry-After` seconds before retrying; the
            `X-RateLimit-*` headers show the budget.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Human-readable error message.
              examples:
                Rate limited:
                  summary: Budget for the current minute exhausted
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              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.update_kyb_party_draft(
                "33333333-4444-5555-6666-777777777777",
                "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
                ownership_percent=55.0,
            )
            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.updateKybPartyDraft(
              "33333333-4444-5555-6666-777777777777",
              "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
              {
                ownership_percent: 55.0,
              },
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.UpdateKYBPartyDraft(ctx, \"33333333-4444-5555-6666-777777777777\", \"5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d\", didit.SessionsUpdateKYBPartyDraftParams{\n\tOwnershipPercent: didit.Float(55.0),\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.SessionsUpdateKybPartyDraftParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().updateKybPartyDraft("33333333-4444-5555-6666-777777777777",
            "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
            SessionsUpdateKybPartyDraftParams.builder()
                    .ownershipPercent(55.0)
                    .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->updateKybPartyDraft('33333333-4444-5555-6666-777777777777',
            '5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d', [
                'ownership_percent' => 55.0,
            ]);

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

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

            result = didit.sessions.update_kyb_party_draft(
              "33333333-4444-5555-6666-777777777777",
              "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d",
              ownership_percent: 55.0
            )
            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.UpdateKybPartyDraftAsync("33333333-4444-5555-6666-777777777777",
            "5b0d7a52-9d3e-4f0c-8c6a-0e5f3a1b2c4d", new
            SessionsUpdateKybPartyDraftParams

            {
                OwnershipPercent = 55.0,
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your application's API key, from Developers -> API keys in the Business
        Console. The primary key has full access. A named key can be scoped:
        none, read or write per resource, limited to some workflows or to
        approved sessions, to a list of IP addresses, and to an expiry date. 401
        means the key is missing, wrong, revoked or expired; 403 means the key
        has no access to this resource or action, or the request came from an
        address outside its IP list; 404 on a session route means the session is
        outside the key's workflows or statuses. A key without media access
        receives image, video and PDF URLs as null, and a key without sessions
        write receives session links and tokens as null. See
        https://docs.didit.me/console/api-keys.

````

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