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

# Document AI 데이터 업데이트 API

> Didit이 KYC 또는 KYB 세션의 Document 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/ko/core-technology/document-ai/overview.md)를, 세션 결정에서 결과가 표시되는 위치는 [Document AI 보고서](https://docs.didit.me/ko/core-technology/document-ai/report-document-ai.md)를 참고하십시오.


## OpenAPI

````yaml ko/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/ko/integration/webhooks)을 전송합니다. 범위가 지정된
        API 키에는 `decisions: write` 권한이 필요합니다. [Document
        AI](https://docs.didit.me/ko/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 허용 목록 외부에서 보낸 요청의 경우에도 마찬가지입니다.
            잘못되었거나 취소되었거나 만료된 키는 `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: >-
        Business Console의 Developers -> API keys에서 발급받은 귀하 애플리케이션의 API 키입니다. 기본
        키는 전체 접근 권한을 갖습니다. 이름이 지정된 키는 리소스별 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.