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

# AML-Prüfstatus per API aktualisieren

> Didit API: Setzen Sie den AML-Status einer Sitzung, z. B. genehmigt nach Bereinigung der Treffer, ohne die Gesamtentscheidung zu ändern.



Prompt für die API zur Aktualisierung des AML-Prüfstatus
        Prompt in die Zwischenablage kopieren



      
      

\<pre>

\`Set the status of the AML screening check of a Didit verification session through the API.

Endpoint:
PATCH https://verification.didit.me/v3/session/{session_id}/update-aml-status/

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

Goal:
\- Record my compliance decision on a session's AML check as a whole (the status of an aml_screenings[] entry in the session decision), for example Approved after my team cleared every hit.

Request body (JSON):
\- status (required): "Approved", "Declined", "In Review", "Not Finished" or "Resub Requested".
\- node_id (optional): the workflow node ID of the AML check when the session ran several AML steps. It can also be sent as the node_id query parameter. Without it the most recent AML check is updated.

Behavior:
\- Works for user (KYC) and business (KYB) session IDs.
\- Only the AML check changes. The session status is not recomputed: use PATCH /v3/session/{session_id}/update-status/ to change the session decision, and PATCH /v3/session/{session_id}/update-aml-hit-status/ to mark individual hits.
\- When the status changes, Didit adds an AML_STATUS_UPDATED activity entry and sends a data.updated webhook.
\- Sending the status the check already has returns 200 and changes nothing (no activity entry, no webhook).

Example call:
curl -X PATCH "https://verification.didit.me/v3/session/11111111-2222-3333-4444-555555555555/update-aml-status/" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "Approved"}'

What to read from the response:
\- status: the AML check status now.
\- previous_status: the status before the call (equal to status when nothing changed).

Failure modes:
\- 400: status missing or not one of the allowed values.
\- 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 it has no AML check (for that node_id). This is checked before the body, so it wins over a 400.

Side effects: changes the AML check status, adds an activity entry and sends a data.updated webhook (only when the status changed).

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

\</pre>



      
      

Einfügen in

Um über einzelne Treffer statt über die gesamte Prüfung zu entscheiden, verwenden Sie [AML-Trefferstatus aktualisieren](https://docs.didit.me/de/sessions-api/update-aml-hit-status.md). Informationen dazu, wie Screening-Ergebnisse und Status entstehen, finden Sie unter [AML-Screening](https://docs.didit.me/de/core-technology/aml-screening/overview.md).


## OpenAPI

````yaml de/openapi-25.json PATCH /v3/session/{sessionId}/update-aml-status/
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/session/{sessionId}/update-aml-status/:
    patch:
      tags:
        - Sessions
      summary: Status einer AML-Prüfung aktualisieren
      description: >-
        Legen Sie den Status der AML-Screening-Prüfung einer Sitzung als Ganzes
        fest (den `status` eines `aml_screenings[]`-Eintrags in der
        Sitzungsentscheidung), beispielsweise `Approved`, nachdem Ihr Team jeden
        Treffer geklärt hat. Funktioniert für KYC- und KYB-Sitzungs-IDs;
        übergeben Sie `node_id` (Query-Parameter oder Body-Feld), wenn die
        Sitzung mehr als einen AML-Schritt durchlaufen hat, andernfalls wird die
        jüngste AML-Prüfung aktualisiert. Wenn sich der Status tatsächlich
        ändert, wird ein Aktivitätseintrag `AML_STATUS_UPDATED` erfasst und ein
        [Webhook](https://docs.didit.me/de/integration/webhooks) `data.updated`
        gesendet; das Senden des aktuellen Status gibt `200` zurück und ändert
        nichts. Der Sitzungsstatus wird nicht neu berechnet: Verwenden Sie
        `PATCH /v3/session/{sessionId}/update-status/` für die
        Sitzungsentscheidung und `PATCH
        /v3/session/{sessionId}/update-aml-hit-status/` für einzelne Treffer.
        Ein berechtigungsbeschränkter API-Schlüssel benötigt `decisions: write`.
      operationId: patch_v3_session_update_aml_status
      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: node_id
          in: query
          required: false
          description: >-
            Workflow-Graph-Knoten-ID der zu aktualisierenden AML-Prüfung. Nur
            erforderlich, wenn die Sitzung mehr als einen AML-Schritt
            durchlaufen hat. Hat Vorrang vor `node_id` im Body.
          schema:
            type: string
            example: feature_aml_1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - Not Finished
                    - Approved
                    - Declined
                    - In Review
                    - Resub Requested
                  description: Neuer Status der AML-Prüfung.
                  example: Approved
                node_id:
                  type: string
                  description: >-
                    Workflow-Graph-Knoten-ID der AML-Prüfung als Alternative zum
                    Query-Parameter.
                  example: feature_aml_1
            example:
              status: Approved
      responses:
        '200':
          description: >-
            Status der AML-Prüfung gesetzt (oder unverändert, wenn er diesen
            Wert bereits hatte).
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - status
                  - previous_status
                properties:
                  message:
                    type: string
                    description: Immer `AML status updated successfully`.
                  status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: Status der AML-Prüfung zum aktuellen Zeitpunkt.
                  previous_status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: >-
                      Status vor dem Aufruf. Entspricht `status`, wenn sich
                      nichts geändert hat.
              example:
                message: AML status updated successfully
                status: Approved
                previous_status: In Review
        '400':
          description: >-
            Validierungsfehler: `status` fehlt oder ist keiner der zulässigen
            Werte. Der AML-Check-Lookup wird zuerst ausgeführt, daher gibt eine
            Sitzung ohne AML-Check auch bei einem ungültigen Body `404` zurück.
          content:
            application/json:
              examples:
                Missing status:
                  summary: Leerer Body oder kein Status
                  value:
                    status:
                      - This field is required.
                Invalid status:
                  summary: status nicht im Enum enthalten
                  value:
                    status:
                      - '"Cleared" is not a valid choice.'
        '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 sie verfügt über keine
            AML-Prüfung (für die angegebene `node_id`). 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.
                No AML check:
                  summary: Die Sitzung hat nie einen AML-Schritt ausgeführt
                  value:
                    detail: The session does not have an AML check.
                No AML check for node:
                  summary: node_id stimmt mit keiner AML-Prüfung der Sitzung überein
                  value:
                    detail: >-
                      The session does not have an AML check for node
                      'feature_aml_2'.
        '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/session/11111111-2222-3333-4444-555555555555/update-aml-status/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"status": "Approved"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.sessions.update_aml_status(
                "11111111-2222-3333-4444-555555555555",
                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.updateAmlStatus("11111111-2222-3333-4444-555555555555",
            {
              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.UpdateAMLStatus(ctx, \"11111111-2222-3333-4444-555555555555\", didit.SessionsUpdateAMLStatusParams{\n\tStatus: \"Approved\",\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.SessionsUpdateAmlStatusParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.sessions().updateAmlStatus("11111111-2222-3333-4444-555555555555",
            SessionsUpdateAmlStatusParams.builder()
                    .status(SessionsUpdateAmlStatusParams.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->updateAmlStatus('11111111-2222-3333-4444-555555555555',
            [
                '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_aml_status(
              "11111111-2222-3333-4444-555555555555",
              status: "Approved"
            )
            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.UpdateAmlStatusAsync("11111111-2222-3333-4444-555555555555",
            new SessionsUpdateAmlStatusParams

            {
                Status = "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.