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

# दस्तावेज़ AI डेटा अपडेट करें API

> KYC या KYB सत्यापन सत्र में, Didit के दस्तावेज़ AI से निकाले गए फ़ील्ड सुधारें या उस दस्तावेज़ की समीक्षा स्थिति सेट करें।



Document AI डेटा अपडेट करने के लिए API प्रॉम्प्ट
        प्रॉम्प्ट को क्लिपबोर्ड पर कॉपी करें



      
      

\<pre>

\`Correct the extracted data of a Document AI document, or set its review status, on a Didit verification session through the API.

Endpoint:
PATCH https://verification.didit.me/v3/document-ai/{session_id}/documents/{document_uuid}/

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

Goal:
\- Fix a value Document AI misread, or approve or decline a document the workflow sent to review.

Request body (JSON, both fields optional):
\- extracted_data: a JSON object of field keys to new values. Merged key by key: sent keys replace the stored values (a null value clears one), keys I leave out keep their values. Do not send extracted_data itself as null (400); leave it out instead.
\- status: "Approved", "Declined", "In Review" or "Not Finished".

Behavior:
\- Works for user (KYC) and business (KYB) session IDs.
\- {document_uuid} is document_ai_documents[].items[].uuid from GET /v3/session/{session_id}/decision/, and the document must belong to that session.
\- The document status feeds the Document AI result of its workflow node in the decision. The session status is not recomputed.
\- Every successful call, even one that changes nothing, sends a data.updated webhook with trigger "manual_review".

Example call:
curl -X PATCH "https://verification.didit.me/v3/document-ai/11111111-2222-3333-4444-555555555555/documents/44444444-5555-6666-7777-888888888888/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"extracted_data": {"invoice_number": "INV-2026-0042"}, "status": "Approved"}'

What to read from the response:
\- extracted_data: all extracted fields after the merge.
\- status: the document's review status.
\- file_url: the storage path of the file, not a download link. Read the presigned file_url from the session decision to download it.

Failure modes:
\- 400: status is not one of the allowed values, or extracted_data is null (checked before the document is looked up).
\- 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, or the document does not belong to the session.

Side effects: updates the document and sends a data.updated webhook.

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

\</pre>



      
      

यहाँ पेस्ट करें

फ़ील्ड कुंजियाँ वही हैं जो आपने वर्कफ़्लो में दस्तावेज़ के लिए कॉन्फ़िगर की हैं। दस्तावेज़ और फ़ील्ड कैसे सेट किए जाते हैं, यह जानने के लिए [Document AI](https://docs.didit.me/hi/core-technology/document-ai/overview.md) देखें, और सत्र निर्णय में परिणाम कहाँ दिखता है, यह जानने के लिए [Document AI रिपोर्ट](https://docs.didit.me/hi/core-technology/document-ai/report-document-ai.md) देखें।


## OpenAPI

````yaml hi/openapi-25.json PATCH /v3/document-ai/{sessionId}/documents/{documentUuid}/
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/document-ai/{sessionId}/documents/{documentUuid}/:
    patch:
      tags:
        - Sessions
      summary: एक Document AI दस्तावेज़ अपडेट करें
      description: >-
        एक KYC या KYB सत्र पर, Document AI द्वारा एक अपलोड किए गए दस्तावेज़ से
        निकाले गए फ़ील्ड को सही करें, इसकी समीक्षा स्थिति सेट करें, या दोनों
        करें। `extracted_data` एक JSON ऑब्जेक्ट होना चाहिए और इसे कुंजी दर कुंजी
        मर्ज किया जाता है: आपके द्वारा भेजी गई कुंजी संग्रहीत मान को बदल देती है
        (`null` के रूप में भेजी गई कुंजी `null` के रूप में संग्रहीत होती है) और
        जो कुंजियाँ आप छोड़ देते हैं वे अपने मान बनाए रखती हैं। दस्तावेज़ की
        स्थिति सत्र निर्णय में इसके वर्कफ़्लो नोड के Document AI परिणाम को फ़ीड
        करती है; सत्र स्थिति की स्वयं पुनर्गणना नहीं की जाती है। प्रत्येक सफल
        कॉल, जिसमें कुछ भी नहीं बदलने वाली कॉल भी शामिल है, `manual_review`
        ट्रिगर के साथ एक `data.updated`
        [webhook](https://docs.didit.me/hi/integration/webhooks) भेजती है। एक
        स्कोप्ड API कुंजी को `decisions: write` की आवश्यकता होती है; [Document
        AI](https://docs.didit.me/hi/core-technology/document-ai/overview)
        देखें।
      operationId: patch_v3_document_ai_document
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            सत्यापन सत्र का UUID (`POST /v3/session/` द्वारा लौटाया गया
            `session_id`)। उपयोगकर्ता सत्यापन (KYC) और व्यवसाय सत्यापन (KYB)
            दोनों सत्र ID स्वीकार करता है: सर्वर दोनों सत्र प्रकारों में ID को
            रिज़ॉल्व करता है। यह एक सही प्रारूप वाला UUID होना चाहिए; गलत
            प्रारूप वाला मान रूट से मेल नहीं खाता है और एक HTML `404` लौटाता है।
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: documentUuid
          in: path
          required: true
          description: >-
            Document AI दस्तावेज़ का UUID (`GET
            /v3/session/{sessionId}/decision/` में
            `document_ai_documents[].items[].uuid`)। यह पाथ के सत्र से संबंधित
            होना चाहिए।
          schema:
            type: string
            format: uuid
            example: 44444444-5555-6666-7777-888888888888
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                extracted_data:
                  type: object
                  additionalProperties: true
                  description: >-
                    फ़ील्ड कुंजियाँ (दस्तावेज़ के लिए आपके द्वारा कॉन्फ़िगर की
                    गई कुंजियाँ) और उनके सही किए गए मान। एक JSON ऑब्जेक्ट होना
                    चाहिए; संग्रहीत डेटा में कुंजी दर कुंजी मर्ज किया जाता है।
                    `null` भेजने के बजाय इसे छोड़ दें, जिससे `400` वापस आता है।
                  example:
                    invoice_number: INV-2026-0042
                status:
                  type: string
                  enum:
                    - Approved
                    - Declined
                    - In Review
                    - Not Finished
                  description: दस्तावेज़ की नई समीक्षा स्थिति।
                  example: Approved
            example:
              extracted_data:
                invoice_number: INV-2026-0042
              status: Approved
      responses:
        '200':
          description: दस्तावेज़ अपडेट किया गया। मर्ज के बाद दस्तावेज़ लौटाता है।
          content:
            application/json:
              schema:
                type: object
                required:
                  - uuid
                  - document_key
                  - original_filename
                  - file_url
                  - status
                  - extracted_data
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: दस्तावेज़ पहचानकर्ता।
                  document_key:
                    type: string
                    description: कॉन्फ़िगर किया गया दस्तावेज़ जिससे यह अपलोड संबंधित है।
                  original_filename:
                    type: string
                    nullable: true
                    description: फ़ाइल नाम जिसके साथ दस्तावेज़ अपलोड किया गया था।
                  file_url:
                    type: string
                    nullable: true
                    description: >-
                      अपलोड की गई फ़ाइल का स्टोरेज पाथ। यह कोई डाउनलोड लिंक नहीं
                      है: फ़ाइल डाउनलोड करने के लिए सत्र निर्णय से प्री-साइन्ड
                      `file_url` पढ़ें।
                  status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: दस्तावेज़ की समीक्षा स्थिति।
                  extracted_data:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: >-
                      मर्ज के बाद सभी निकाले गए फ़ील्ड, जिन्हें फ़ील्ड कुंजी
                      द्वारा व्यवस्थित किया गया है।
              example:
                uuid: 44444444-5555-6666-7777-888888888888
                document_key: invoice
                original_filename: invoice-2026-09.pdf
                file_url: >-
                  document_ai/11111111-2222-3333-4444-555555555555-66666666-7777-8888-9999-000000000000.pdf
                status: Approved
                extracted_data:
                  invoice_number: INV-2026-0042
                  total_amount: 1250
                  issue_date: '2026-09-01'
        '400':
          description: >-
            सत्यापन त्रुटि, दस्तावेज़ देखे जाने से पहले जांची गई: `status` अनुमत
            मानों में से एक नहीं है, या `extracted_data` को `null` के रूप में
            भेजा गया है।
          content:
            application/json:
              examples:
                Invalid status:
                  summary: status enum में नहीं है
                  value:
                    status:
                      - '"Rejected" is not a valid choice.'
                Null extracted_data:
                  summary: extracted_data null है
                  value:
                    extracted_data:
                      - This field may not be 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 अनुमति सूची (allowlist) के
            बाहर से किया गया अनुरोध भी यही लौटाता है; गलत, निरस्त या समय-सीमा
            समाप्त कुंजी `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 वाला कोई वर्तमान दस्तावेज़ इससे संबंधित नहीं है।
            सत्र लुकअप क्रेडेंशियल जांच से पहले चलता है, इसलिए एक अज्ञात
            `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 document:
                  summary: documentUuid सत्र से संबंधित नहीं है
                  value:
                    detail: Document AI document not found.
        '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 PATCH
            'https://verification.didit.me/v3/document-ai/11111111-2222-3333-4444-555555555555/documents/44444444-5555-6666-7777-888888888888/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"extracted_data": {"invoice_number": "INV-2026-0042"}, "status": "Approved"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.update_document_ai_data(
                "11111111-2222-3333-4444-555555555555",
                "44444444-5555-6666-7777-888888888888",
                extracted_data={"invoice_number": "INV-2026-0042"},
                status="Approved",
            )
            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.updateDocumentAiData(
              "11111111-2222-3333-4444-555555555555",
              "44444444-5555-6666-7777-888888888888",
              {
                extracted_data: { invoice_number: "INV-2026-0042" },
                status: "Approved",
              },
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Sessions.UpdateDocumentAiData(ctx, \"11111111-2222-3333-4444-555555555555\", \"44444444-5555-6666-7777-888888888888\", didit.SessionsUpdateDocumentAiDataParams{\n\tExtractedData: didit.Some(map[string]any{\"invoice_number\": \"INV-2026-0042\"}),\n\tStatus:        didit.Some(didit.SessionsUpdateDocumentAiDataParamsStatus(\"Approved\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.Map;

            import me.didit.Didit;

            import me.didit.types.SessionsUpdateDocumentAiDataParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().updateDocumentAiData("11111111-2222-3333-4444-555555555555",
            "44444444-5555-6666-7777-888888888888",
            SessionsUpdateDocumentAiDataParams.builder()
                    .extractedData(Map.of("invoice_number", "INV-2026-0042"))
                    .status(SessionsUpdateDocumentAiDataParams.Status.of("Approved"))
                    .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->updateDocumentAiData('11111111-2222-3333-4444-555555555555',
            '44444444-5555-6666-7777-888888888888', [
                'extracted_data' => ['invoice_number' => 'INV-2026-0042'],
                'status' => 'Approved',
            ]);

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

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

            result = didit.sessions.update_document_ai_data(
              "11111111-2222-3333-4444-555555555555",
              "44444444-5555-6666-7777-888888888888",
              extracted_data: { invoice_number: "INV-2026-0042" },
              status: "Approved"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Collections.Generic;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Sessions.UpdateDocumentAiDataAsync("11111111-2222-3333-4444-555555555555",
            "44444444-5555-6666-7777-888888888888", new
            SessionsUpdateDocumentAiDataParams

            {
                ExtractedData = new Dictionary<string, object> { ["invoice_number"] = "INV-2026-0042" },
                Status = new SessionsUpdateDocumentAiDataParamsStatus("Approved"),
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        आपकी एप्लिकेशन की API कुंजी, Business Console में Developers -> API keys
        से। प्राथमिक कुंजी के पास पूर्ण एक्सेस होता है। एक नामित कुंजी को स्कोप
        किया जा सकता है: प्रति संसाधन none, read या write, कुछ वर्कफ़्लो या
        स्वीकृत सत्रों तक सीमित, IP पतों की सूची तक सीमित, और समाप्ति तिथि तक
        सीमित। 401 का अर्थ है कि कुंजी गलत है, निरस्त कर दी गई है या उसकी
        समय-सीमा समाप्त हो गई है; 403 का अर्थ है कि कोई कुंजी नहीं भेजी गई थी,
        कुंजी के पास इस संसाधन या कार्रवाई का एक्सेस नहीं है, या अनुरोध उसकी IP
        सूची से बाहर के पते से आया था; सत्र रूट पर 404 का अर्थ है कि सत्र कुंजी
        के वर्कफ़्लो या स्थितियों से बाहर है। मीडिया एक्सेस के बिना एक कुंजी को
        छवि, वीडियो और PDF URL null के रूप में प्राप्त होते हैं, और सत्र write
        के बिना एक कुंजी को सत्र लिंक और token null के रूप में प्राप्त होते हैं।
        देखें https://docs.didit.me/console/api-keys।

````

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