> ## 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-Daten aktualisieren API

> Korrigieren Sie von Didit extrahierte Felder eines Document AI-Dokuments oder setzen Sie dessen Prüfstatus bei KYC- oder KYB-Sitzungen.



Prompt für die API zur Aktualisierung von Document-AI-Daten
        Prompt in die Zwischenablage kopieren



      
      

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



      
      

Einfügen in

Die Feldschlüssel sind die, die Sie für das Dokument im Workflow konfiguriert haben. Informationen dazu, wie Dokumente und Felder eingerichtet werden, finden Sie unter [Document AI](https://docs.didit.me/de/core-technology/document-ai/overview.md). Im [Document-AI-Bericht](https://docs.didit.me/de/core-technology/document-ai/report-document-ai.md) sehen Sie, wo das Ergebnis in der Sitzungsentscheidung erscheint.


## OpenAPI

````yaml de/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 für Ausweisverifizierung. Authentifizierung über den x-api-key-Header.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/document-ai/{sessionId}/documents/{documentUuid}/:
    patch:
      tags:
        - Sessions
      summary: Document AI-Dokument aktualisieren
      description: >-
        Korrigieren Sie die von Document AI aus einem hochgeladenen Dokument
        extrahierten Felder, legen Sie dessen Prüfstatus fest oder beides in
        einer KYC- oder KYB-Sitzung. `extracted_data` muss ein JSON-Objekt sein
        und wird Schlüssel für Schlüssel zusammengeführt: Ein von Ihnen
        gesendeter Schlüssel ersetzt den gespeicherten Wert (ein als `null`
        gesendeter Schlüssel wird als `null` gespeichert), und weggelassene
        Schlüssel behalten ihre Werte. Der Dokumentenstatus fließt in das
        Document AI-Ergebnis seines Workflow-Knotens in der Sitzungsentscheidung
        ein; der Sitzungsstatus selbst wird nicht neu berechnet. Jeder
        erfolgreiche Aufruf, auch einer, der nichts ändert, sendet einen
        `data.updated`-[Webhook](https://docs.didit.me/de/integration/webhooks)
        mit dem Auslöser `manual_review`. Ein berechtigungsbeschränkter
        API-Schlüssel erfordert `decisions: write`; siehe [Document
        AI](https://docs.didit.me/de/core-technology/document-ai/overview).
      operationId: patch_v3_document_ai_document
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            UUID der Verifizierungssitzung (die von `POST /v3/session/`
            zurückgegebene `session_id`). Akzeptiert Sitzungs-IDs sowohl für die
            Benutzerverifizierung (KYC) als auch für die
            Unternehmensverifizierung (KYB): Der Server löst die ID über beide
            Sitzungstypen hinweg auf. Muss eine wohlgeformte UUID sein; ein
            fehlerhafter Wert entspricht nicht der Route und gibt ein HTML-`404`
            zurück.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: documentUuid
          in: path
          required: true
          description: >-
            UUID des Document AI-Dokuments
            (`document_ai_documents[].items[].uuid` in `GET
            /v3/session/{sessionId}/decision/`). Es muss zu der Sitzung im Pfad
            gehören.
          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: >-
                    Feldschlüssel (die von Ihnen für das Dokument konfigurierten
                    Schlüssel) und deren korrigierte Werte. Muss ein JSON-Objekt
                    sein; wird Schlüssel für Schlüssel in die gespeicherten
                    Daten zusammengeführt. Lassen Sie das Feld lieber weg,
                    anstatt `null` zu senden, was zu einem `400` führt.
                  example:
                    invoice_number: INV-2026-0042
                status:
                  type: string
                  enum:
                    - Approved
                    - Declined
                    - In Review
                    - Not Finished
                  description: Neuer Prüfungsstatus des Dokuments.
                  example: Approved
            example:
              extracted_data:
                invoice_number: INV-2026-0042
              status: Approved
      responses:
        '200':
          description: Dokument aktualisiert. Gibt das Dokument nach dem Merge zurück.
          content:
            application/json:
              schema:
                type: object
                required:
                  - uuid
                  - document_key
                  - original_filename
                  - file_url
                  - status
                  - extracted_data
                properties:
                  uuid:
                    type: string
                    format: uuid
                    description: Dokumentenbezeichner.
                  document_key:
                    type: string
                    description: Das konfigurierte Dokument, dem dieser Upload entspricht.
                  original_filename:
                    type: string
                    nullable: true
                    description: Dateiname, mit dem das Dokument hochgeladen wurde.
                  file_url:
                    type: string
                    nullable: true
                    description: >-
                      Speicherpfad der hochgeladenen Datei. Dies ist kein
                      Download-Link: Lesen Sie die vorab signierte `file_url`
                      aus der Sitzungsentscheidung aus, um die Datei
                      herunterzuladen.
                  status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: Prüfstatus des Dokuments.
                  extracted_data:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: >-
                      Alle extrahierten Felder nach der Zusammenführung,
                      indexiert nach Feldschlüssel.
              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: >-
            Validierungsfehler, der vor dem Nachschlagen des Dokuments geprüft
            wird: `status` ist keiner der zulässigen Werte oder `extracted_data`
            wurde als `null` übermittelt.
          content:
            application/json:
              examples:
                Invalid status:
                  summary: status nicht im Enum enthalten
                  value:
                    status:
                      - '"Rejected" is not a valid choice.'
                Null extracted_data:
                  summary: extracted_data ist null
                  value:
                    extracted_data:
                      - This field may not be null.
        '401':
          description: >-
            Der API-Schlüssel mit eingeschränktem Geltungsbereich ist
            abgelaufen. Dies ist der einzige Fall, der `401` zurückgibt: Ein
            fehlender, ungültiger oder widerrufener Schlüssel gibt `403` zurück.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Lesbare Fehlermeldung.
              examples:
                Expired key:
                  summary: Das Ablaufdatum des Schlüssels ist überschritten
                  value:
                    detail: This API key has expired.
        '403':
          description: >-
            Authentifizierungs- oder Autorisierungsfehler. Ein fehlender
            Schlüssel gibt `403` zurück, ebenso wie der Schlüssel einer anderen
            Anwendung, ein berechtigungsbeschränkter Schlüssel ohne die für
            diesen Endpoint erforderliche Berechtigung sowie eine Anfrage von
            außerhalb der IP-Allowlist des Schlüssels; ein falscher,
            widerrufener oder abgelaufener Schlüssel gibt `401` zurück.
            Unterscheiden Sie diese anhand von `detail`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Lesbare Fehlermeldung.
              examples:
                Missing or invalid credentials:
                  summary: >-
                    Kein x-api-key-Header vorhanden oder die Validierung des
                    Schlüssels ist fehlgeschlagen
                  value:
                    detail: >-
                      Authentication credentials were not provided or are
                      invalid.
                Other application:
                  summary: >-
                    Ein gültiger Schlüssel, der zu einer anderen Anwendung als
                    die Sitzung gehört
                  value:
                    detail: You do not have permission to perform this action.
                Scoped key without decisions write:
                  summary: >-
                    Dem Schlüssel mit eingeschränktem Berechtigungsumfang fehlt
                    decisions: write
                  value:
                    detail: This API key has no write access to decisions.
                IP not allowed:
                  summary: Anfrage von außerhalb der IP-Allowlist des Schlüssels
                  value:
                    detail: This API key can't be used from this IP address.
        '404':
          description: >-
            Die Sitzung existiert nicht, wurde gelöscht oder liegt außerhalb der
            Beschränkungen eines Scoped Keys, oder es gehört kein aktuelles
            Dokument mit dieser UUID dazu. Die Sitzungssuche erfolgt vor der
            Prüfung der Anmeldedaten, sodass eine unbekannte `sessionId` auch
            ohne gültigen Schlüssel `404` zurückgibt.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Lesbare Fehlermeldung.
              examples:
                Unknown session:
                  summary: >-
                    Es existiert keine Sitzung mit dieser ID oder sie wurde
                    gelöscht
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: >-
                    Die Sitzung liegt außerhalb der Beschränkungen eines Scoped
                    Keys (wird auch für eine vor Kurzem gelöschte Sitzung
                    zurückgegeben)
                  value:
                    detail: Session not found.
                Unknown document:
                  summary: documentUuid gehört nicht zur Sitzung
                  value:
                    detail: Document AI document not found.
        '429':
          description: >-
            Rate-Limit überschritten: 300 Schreibanfragen (POST, PATCH, DELETE)
            pro Minute pro API-Schlüssel. Warten Sie `Retry-After` Sekunden vor
            einem Wiederholungsversuch; die `X-RateLimit-*`-Header zeigen das
            Budget an.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Lesbare Fehlermeldung.
              examples:
                Rate limited:
                  summary: Budget für die aktuelle Minute erschöpft
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
          headers:
            Retry-After:
              description: >-
                Sekunden, die vor einem Wiederholungsversuch gewartet werden
                müssen.
              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: >-
        Der API-Schlüssel Ihrer Anwendung, aus Entwickler -> API-Schlüssel in
        der Business Console. Der Primärschlüssel hat Vollzugriff. Ein benannter
        Schlüssel kann im Geltungsbereich eingeschränkt werden: keine, Lese-
        oder Schreibberechtigung pro Ressource, beschränkt auf bestimmte
        Workflows oder genehmigte Sitzungen, auf eine Liste von IP-Adressen und
        auf ein Ablaufdatum. 401 bedeutet, dass der Schlüssel falsch, widerrufen
        oder abgelaufen ist; 403 bedeutet, dass kein Schlüssel gesendet wurde,
        der Schlüssel keinen Zugriff auf diese Ressource oder Aktion hat oder
        die Anfrage von einer Adresse außerhalb seiner IP-Liste stammte; 404 bei
        einer Sitzungsroute bedeutet, dass die Sitzung außerhalb der Workflows
        oder Status des Schlüssels liegt. Ein Schlüssel ohne Medienzugriff
        erhält Bild-, Video- und PDF-URLs als null, und ein Schlüssel ohne
        Schreibberechtigung für Sitzungen erhält Sitzungslinks und Token als
        null. Siehe https://docs.didit.me/console/api-keys.

````

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