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

> تعيين حالة فحص AML لجلسة في Didit، مثل مقبولة بعد معالجة نتائجه، دون تغيير القرار العام للجلسة.



موجّه واجهة API لتحديث حالة فحص AML
        نسخ الموجّه إلى الحافظة



      
      

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



      
      

الصق في

لاتخاذ قرار بشأن التطابقات الفردية بدلاً من الفحص الكامل، استخدم [تحديث حالة تطابق AML](https://docs.didit.me/ar/sessions-api/update-aml-hit-status.md). أما كيفية إنتاج نتائج الفحص والحالات، فراجع [فحص AML](https://docs.didit.me/ar/core-technology/aml-screening/overview.md).


## OpenAPI

````yaml ar/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 التحقق من الهوية. قم بالمصادقة باستخدام الرأس x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/session/{sessionId}/update-aml-status/:
    patch:
      tags:
        - Sessions
      summary: تحديث حالة فحص AML
      description: >-
        تعيين حالة فحص AML للجلسة ككل (حالة `status` لإدخال `aml_screenings[]`
        في قرار الجلسة)، على سبيل المثال `Approved` بعد قيام فريقك بحل كل
        مطابقة. يعمل مع معرّفات جلسات KYC و KYB؛ مرّر `node_id` (معامل استعلام
        أو حقل في نص الطلب) عندما تتضمن الجلسة أكثر من خطوة AML واحدة، وإلا
        فسيتم تحديث أحدث فحص AML. عندما تتغير الحالة فعلياً، يتم تسجيل إدخال
        نشاط `AML_STATUS_UPDATED` ويتم إرسال
        [webhook](https://docs.didit.me/ar/integration/webhooks) من نوع
        `data.updated`؛ يؤدي إرسال الحالة الحالية إلى إرجاع `200` دون تغيير أي
        شيء. لا تتم إعادة احتساب حالة الجلسة: استخدم `PATCH
        /v3/session/{sessionId}/update-status/` لقرار الجلسة و `PATCH
        /v3/session/{sessionId}/update-aml-hit-status/` لنتائج المطابقة الفردية.
        يتطلب مفتاح API محدد النطاق صلاحية `decisions: write`.
      operationId: patch_v3_session_update_aml_status
      parameters:
        - name: sessionId
          in: path
          required: true
          description: >-
            معرّف UUID لجلسة التحقق (`session_id` الذي تم إرجاعه بواسطة `POST
            /v3/session/`). يقبل معرّفات جلسات التحقق من المستخدمين (KYC)
            والتحقق من الشركات (KYB): يطابق الخادم المعرّف عبر كلا نوعي الجلسات.
            يجب أن يكون UUID صالح البنية؛ تؤدي القيمة غير صالحة البنية إلى عدم
            مطابقة المسار وإرجاع `404` بتنسيق HTML.
          schema:
            type: string
            format: uuid
            example: 11111111-2222-3333-4444-555555555555
        - name: node_id
          in: query
          required: false
          description: >-
            معرّف عقدة مخطط سير العمل لفحص AML المراد تحديثه. مطلوب فقط عند
            تشغيل الجلسة لأكثر من خطوة AML واحدة. له الأولوية على `node_id` في
            جسم الطلب.
          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: الحالة الجديدة لفحص AML.
                  example: Approved
                node_id:
                  type: string
                  description: معرّف عقدة مخطط سير العمل لفحص AML، كبديل لمعامل الاستعلام.
                  example: feature_aml_1
            example:
              status: Approved
      responses:
        '200':
          description: >-
            تم تعيين حالة فحص AML (أو بقيت دون تغيير عندما كانت تحمل هذه القيمة
            بالفعل).
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - status
                  - previous_status
                properties:
                  message:
                    type: string
                    description: دائماً `AML status updated successfully`.
                  status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: حالة فحص AML الآن.
                  previous_status:
                    type: string
                    enum:
                      - Not Finished
                      - Approved
                      - Declined
                      - In Review
                      - Resub Requested
                    description: الحالة قبل الاستدعاء. تساوي `status` عندما لا يتغير شيء.
              example:
                message: AML status updated successfully
                status: Approved
                previous_status: In Review
        '400':
          description: >-
            خطأ في التحقق: `status` مفقود أو ليس أحد القيم المسموح بها. يتم
            إجراء البحث عن فحص AML أولاً، لذا فإن الجلسة التي لا تحتوي على فحص
            AML تُرجع `404` حتى مع وجود نص طلب غير صالح.
          content:
            application/json:
              examples:
                Missing status:
                  summary: نص الطلب فارغ أو بدون حالة
                  value:
                    status:
                      - This field is required.
                Invalid status:
                  summary: status ليس ضمن التعداد
                  value:
                    status:
                      - '"Cleared" is not a valid choice.'
        '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: >-
            الجلسة غير موجودة، أو تم حذفها، أو أنها خارج حدود مفتاح ذي نطاق
            محدد، أو ليس لديها فحص AML (لقيمة `node_id` المحددة). يتم البحث عن
            الجلسة قبل التحقق من بيانات الاعتماد، لذلك فإن معرّف `sessionId` غير
            المعروف يُعيد `404` حتى بدون مفتاح صالح.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: رسالة خطأ سهلة القراءة.
              examples:
                Unknown session:
                  summary: لا توجد جلسة بهذا المعرّف، أو أنها حُذفت
                  value:
                    detail: Not found.
                Outside key limits:
                  summary: >-
                    الجلسة خارج حدود مفتاح ذي نطاق محدد (تُعاد أيضاً للجلسة
                    المحذوفة منذ لحظات)
                  value:
                    detail: Session not found.
                No AML check:
                  summary: لم تقم الجلسة بتشغيل خطوة AML على الإطلاق
                  value:
                    detail: The session does not have an AML check.
                No AML check for node:
                  summary: حقل node_id لا يتطابق مع أي فحص AML للجلسة
                  value:
                    detail: >-
                      The session does not have an AML check for node
                      'feature_aml_2'.
        '429':
          description: >-
            تم تجاوز حد المعدل: 300 طلب كتابة (POST وPATCH وDELETE) في الدقيقة
            لكل مفتاح API. انتظر عدد الثواني المحدد في `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/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: >-
        مفتاح API الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ null، ويتلقى المفتاح الذي لا يمتلك
        إذن كتابة للجلسات روابط الجلسة وtoken كـ null. راجع
        https://docs.didit.me/console/api-keys.

````

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