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

# تحديث التطبيق: إدارة تطبيقات العملاء عبر Didit API

> يتيح Didit تحديث البيانات الوصفية للتطبيق عبر PATCH /organizations/me/{org_id}/applications/{app_id}/ لتطبيقات العملاء والعلامات والبيئات.



موجه تحديث التطبيق
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Partially update one Didit application's metadata (name, public URLs, redirect URIs, description). Credentials (client_id, api_key, uuid) are NEVER changed by this call.

Endpoint:
PATCH https://apx.didit.me/auth/v2/organizations/me/{org_id}/applications/{app_id}/

Authentication:
Authorization: Bearer <access_token>
The access token must belong to an OWNER or ADMIN of the organization.

Path parameters:
\- org_id (UUID, required) — Organization that owns the application.
\- app_id (UUID, required) — Application UUID to update.

Request body — PATCH semantics. Send ONLY the fields you want to change. Omitted fields are preserved.
\- name (string, optional) — Display name.
\- website_url (string, URL, optional) — Public homepage.
\- redirect_uris (array of strings, optional) — Allowlisted OAuth-style redirect URIs. The array REPLACES the previous value entirely.
\- terms_url (string, URL, optional) — Terms-of-service link.
\- privacy_url (string, URL, optional) — Privacy policy link.
\- description (string, optional) — Internal note (not shown to end users).
\- products is read-only: a products key in the body is ignored.
\- data_location (string, optional) — The application's data location, chosen when it was created. Naming the location it already has is accepted; any other location answers 400. One exception: the live application created with your organization (at sign-up or by POST /programmatic/verify-email/) has its location chosen by the first update that names data_location, once, while none of its API keys has been used and it has no verification session. Only "eu" (European Union, Ireland) is available today.

What does NOT change:
\- uuid, client_id, api_key — credentials stay the same. Existing integrations keep working; no key rotation happens here.
\- data_location — set when the application is created (see above for the one exception).

curl example — rename and move to a new domain:
curl -X PATCH "https://apx.didit.me/auth/v2/organizations/me/<ORG_ID>/applications/<APP_ID>/" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Production App",
"website_url": "https://app.acme.example"
}'

curl example — add a second redirect URI (full replacement of the array):
curl -X PATCH "https://apx.didit.me/auth/v2/organizations/me/<ORG_ID>/applications/<APP_ID>/" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"redirect_uris": [
  "https://acme.example/callback",
  "https://staging.acme.example/callback"
]
}'

Response (200 OK):
The full application record after the change, including products (same shape as GET /organizations/me/{org_id}/applications/{app_id}/). uuid, client_id, and api_key are unchanged.

When to call:
\- Reseller customer rebrands → rename their application.
\- Domain migration → update website_url, terms_url, privacy_url.
\- Add or remove a staging redirect URI.
\- Refresh terms / privacy URLs shown in the verification flow.

Failure modes:
\- 400 — { "<field>": ["Enter a valid URL."] } for malformed website_url / redirect_uris / terms_url / privacy_url.
\- 400 — { "data_location": ["An application's data location can't be changed after it is created."] } for a location other than the application's own, and { "data_location": ["This data location is not available yet."] } for "au" or "mx". Nothing is changed.
\- 503 — { "detail": "We couldn't confirm that this application is unused. Try again in a moment.", "code": "data_location_check_unavailable" } only while choosing the first application's location. Nothing is changed; retry.
\- 401: { "detail": "Invalid access token" } or { "detail": "Expired access token" } when the token is malformed or expired.
\- 403: { "detail": "Only organization owners and admins can manage applications." } when you are a member of the organization but not an owner or admin.
\- 403: { "detail": "Your access to this organization is suspended." } when your membership in the organization is suspended.
\- 403: { "detail": "You do not have permission to perform this action." } when the request has no Authorization header.
\- 404: { "detail": "Organization not found." } when the organization does not exist or you are not a member of it, or { "detail": "Application not found." } when the application is not in that organization.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

الصق في

استخدم هذا endpoint لإبقاء كل تطبيق متوافقًا مع العميل أو العلامة التجارية أو البيئة أو حالة الاستخدام الداخلية التي يمثلها.بالنسبة إلى الموزعين، يتيح لك هذا إعادة تسمية كل تطبيق للعميل أو تحديثه دون مشاركة بيانات الاعتماد بين العملاء. أما بالنسبة إلى العملاء المباشرين، فيساعد على فصل المنتجات أو المناطق أو البيئات مع الإبقاء على كل ذلك ضمن مؤسسة واحدة.> [!NOTE]
>
> يحدّث هذا endpoint البيانات الوصفية للتطبيق فقط. يبقى `api_key` كما هو ما لم تقم بتدوير بيانات الاعتماد بشكل منفصل.## موقع البياناتيُختار موقع بيانات التطبيق (`data_location`) عند إنشاء التطبيق، ولا يمكن تغييره بعد ذلك: التحديث الذي يذكر الموقع الذي يملكه التطبيق بالفعل يُقبل، وأي موقع آخر يُرجع الاستجابة 400.الاستثناء الوحيد هو التطبيق الحي الذي يُنشأ مع مؤسستك، سواء عند التسجيل أو عبر [التحقق من البريد الإلكتروني](https://docs.didit.me/ar/auth-api/verify-email.md). أول تحديث يذكر `data_location` يحدد موقعه مرة واحدة فقط، بشرط ألا يكون قد استُخدم أي من مفاتيح API الخاصة بالتطبيق، وألا تكون له أي جلسة تحقق. تستخدم خطوة **سمّ تطبيقك الأول** في وحدة التحكم هذا الأمر لحفظ الموقع الذي تختاره هناك. الموقع المتاح حاليًا هو `eu`، أي الاتحاد الأوروبي (أيرلندا).


## OpenAPI

````yaml ar/openapi-auth.json PATCH /organizations/me/{org_id}/applications/{app_id}/
openapi: 3.0.0
info:
  version: 1.0.0
  title: Didit Auth API
  description: >-
    واجهة برمجة تطبيقات (API) للتسجيل والمصادقة البرمجية للمطورين ووكلاء الذكاء
    الاصطناعي. سجّل من خلال استدعاءين فقط لـ API - دون الحاجة إلى متصفح. منصة
    التحقق من الهوية الأكثر ملاءمة للوكلاء.


    ## عنوان URL الأساسي


    تتم استضافة جميع endpoint في هذه المواصفات على
    `https://apx.didit.me/auth/v2`. هذا المضيف مختلف عن API التحقق
    (`https://verification.didit.me/v3`). ميّز بينهما جيداً: يُصدر مضيف المصادقة
    هذا **رموز وصول JWT** الخاصة بك ويسمح لك بسرد وإدارة **المؤسسات**
    و**التطبيقات** التابعة لك. أما مضيف التحقق فهو المكان الذي تستدعي فيه
    الجلسات، وسير العمل، وفحص AML، وما إلى ذلك، بعد المصادقة باستخدام
    **`api_key`** المُرجع بواسطة هذه الـ API.


    ## طريقة عمل تدفق المصادقة


    1. `POST /programmatic/register/` - إرسال البريد الإلكتروني + كلمة المرور.

    2. استلام رمز مكوّن من 6 أحرف وأرقام عبر البريد الإلكتروني.

    3. `POST /programmatic/verify-email/` - إرسال الرمز. ستحصل في المقابل على
    `access_token` الخاص بـ JWT، و`refresh_token`، ومؤسسة، وتطبيق افتراضي يحتوي
    على `client_id` + `api_key`.

    4. احفظ `api_key`. واستخدمه كـ `x-api-key` لكل استدعاء إلى
    `https://verification.didit.me/v3/...`.

    5. من أي جهاز مستقبلاً، يتيح لك `POST /programmatic/login/` استبدال بريدك
    الإلكتروني + كلمة المرور بـ JWT جديد، ثم استدعِ `GET /organizations/me/` و
    endpoint الخاصة بالتطبيق لاستعادة بيانات الاعتماد أو تدويرها.


    لا يلزم JWT إلا لـ endpoint الخاصة بـ **إدارة الحساب** في هذه المواصفات؛
    وتستخدم حركة مرور API التحقق `api_key` طويل الأجل، وليس JWT.


    ## الاصطلاحات


    - جميع نصوص الطلب والاستجابة بتنسيق JSON (`Content-Type: application/json`).

    - **استخدم عنوان بريد إلكتروني حقيقي وقابل للاستلام عند اختبار `POST
    /programmatic/register/`.** يرسل endpoint رمز التحقق بشكل متزامن، لذا فإن
    العناوين الموجودة على نطاقات الاختبار المحجوزة (`@example.com`،
    و`@example.org`، و`@*.test`، و`@*.example`، و`@*.invalid`) تُرفض عند تسليم
    البريد ويعود الطلب بالرمز `500`. استبدل العنصر النائب `you@yourdomain.com`
    في الأمثلة بصندوق بريد وارد يمكنك قراءته فعلياً.

    - تعيد أخطاء التحقق من الصحة رمز الحالة HTTP `400` بإحدى صيغتين: `{"field":
    ["message", ...]}` للمشكلات على مستوى الحقول، أو `{"detail": "message"}`
    لأخطاء قواعد العمل. وترد قلة من أدوات التحقق من الصحة (قوة كلمة المرور عند
    التسجيل، وانتهاء صلاحية الرمز عند التحقق من البريد الإلكتروني) حالياً
    بمصفوفة مجردة `["message"]` بدلاً من الصيغة المحددة بمفتاح الحقل - وهو
    اختلاف معروف من جانب الخادم، لذا يجب أن يقبل كود العميل كلا الشكلين.

    - تعود أخطاء المصادقة على هيئة `{"detail": "..."}` مع HTTP `401` (رمز الحامل
    غير صالح) أو `403` (رمز الحامل مفقود / صلاحيات غير كافية).

    - تتضمن استجابات حد المعدل حقلاً باسم `wait` يحدد فترة الانتظار بالثواني.
servers:
  - url: https://apx.didit.me/auth/v2
    description: خادم مصادقة الإنتاج
security: []
tags:
  - name: Programmatic Auth
    description: >-
      دورة حياة الحساب بالبريد الإلكتروني وكلمة المرور: التسجيل، والتحقق، وتسجيل
      الدخول. يُرجع `access_token` الخاص بـ JWT الذي تستخدمه مع endpoints إدارة
      الحساب، بالإضافة إلى (عند التحقق) `client_id` و`api_key` لتطبيقك الأول.
  - name: Account Management
    description: >-
      الـ endpoints المُصادق عليها (JWT bearer) التي تعرض المؤسسات وتُنشئ
      التطبيقات أو تجلبها أو تُحدّثها. استخدم هذه الـ endpoints لاسترداد أو
      تدوير `api_key` الذي تستخدمه لمصادقة استدعاءات API للتحقق.
paths:
  /organizations/me/{org_id}/applications/{app_id}/:
    patch:
      tags:
        - Account Management
      summary: تحديث التطبيق
      description: >-
        تحديث البيانات الوصفية للتطبيق (الاسم، روابط URL، عناوين URI لإعادة
        التوجيه). لا يتم تدوير `api_key` و`client_id` مطلقاً. حقل `products`
        للقراءة فقط: يتم تجاهل مفتاح `products` في نص الطلب. لا يمكن تغيير
        `data_location` بعد إنشاء التطبيق، باستثناء مرة واحدة في التطبيق المباشر
        الذي تم إنشاؤه مع مؤسستك طالما أنه غير مستخدم (راجع نص الطلب). يتطلب JWT
        للمالك/المسؤول.
      operationId: update_organization_application
      parameters:
        - name: org_id
          in: path
          required: true
          description: معرّف UUID للمؤسسة التي تملك التطبيق.
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-5678-90ab-cdef-111111111111
        - name: app_id
          in: path
          required: true
          description: معرّف UUID للتطبيق المراد تحديثه.
          schema:
            type: string
            format: uuid
            example: b2c3d4e5-6789-01bc-defg-222222222222
      requestBody:
        required: true
        description: >-
          أرسل فقط الحقول التي تريد تغييرها. دلالات PATCH: يتم الاحتفاظ بالحقول
          غير المذكورة.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationUpdateRequest'
            examples:
              RenameCustomerApplication:
                summary: إعادة التسمية والنقل إلى نطاق جديد
                value:
                  name: Acme Production App
                  website_url: https://app.acme.example
              UpdateRedirectUris:
                summary: إضافة معرّف URI ثانٍ لإعادة التوجيه
                value:
                  redirect_uris:
                    - https://acme.example/callback
                    - https://staging.acme.example/callback
              UpdatePolicies:
                summary: تحديث روابط الشروط والخصوصية
                value:
                  terms_url: https://acme.example/v2/terms
                  privacy_url: https://acme.example/v2/privacy
      responses:
        '200':
          description: >-
            تم تحديث التطبيق. الاستجابة هي سجل التطبيق الكامل بعد التغيير، بما
            في ذلك `products`؛ مع بقاء `uuid` و`client_id` و`api_key` دون تغيير.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Success:
                  value:
                    uuid: b2c3d4e5-6789-01bc-defg-222222222222
                    name: Acme Production App
                    client_id: S9LIYGSoWNuGMLHsvEt9dQ
                    api_key: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    website_url: https://app.acme.example
                    redirect_uris:
                      - https://acme.example/callback
                    terms_url: https://acme.example/terms
                    privacy_url: https://acme.example/privacy
                    description: null
                    created_at: '2025-06-01T10:00:00Z'
                    data_location: eu
                    products:
                      - product: identity
                        status: enabled
                        modules:
                          user_verification: true
                          business_verification: true
                          case_management: true
                      - product: transactions
                        status: disabled
                        modules:
                          travel_rule: true
                          case_management: true
                      - product: authentication
                        status: disabled
                        modules: {}
        '400':
          description: >-
            خطأ في التحقق من الصحة في نص الطلب: على سبيل المثال عنوان URL غير
            صحيح التنسيق، أو `data_location` غير متوفر بعد، أو `data_location`
            مختلف عن الخاص بالتطبيق. لم يتم تغيير أي شيء.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                InvalidUrl:
                  value:
                    website_url:
                      - Enter a valid URL.
                DataLocationFixed:
                  summary: موقع بيانات آخر غير الموقع الخاص بالتطبيق
                  value:
                    data_location:
                      - >-
                        An application's data location can't be changed after it
                        is created.
                DataLocationNotAvailable:
                  summary: موقع بيانات سيتوفر قريباً
                  value:
                    data_location:
                      - This data location is not available yet.
        '401':
          description: >-
            token الوصول غير صالح أو مشوه أو منتهي الصلاحية. احصل على واحد جديد
            باستخدام `POST /programmatic/login/`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                InvalidToken:
                  value:
                    detail: Invalid access token
                ExpiredToken:
                  value:
                    detail: Expired access token
        '403':
          description: >-
            لا يمكنك تحديث هذا التطبيق. يحصل عضو المؤسسة الذي ليس مالكاً أو
            مسؤولاً على `Only organization owners and admins can manage
            applications.` بينما يحصل المالك أو المسؤول الذي تم تعليق وصوله إلى
            المؤسسة على `Your access to this organization is suspended.` ويحصل
            الطلب الخالي من الرأس `Authorization` على `You do not have
            permission to perform this action.`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                NotOwnerOrAdmin:
                  summary: عضو ليس مالكاً أو مسؤولاً
                  value:
                    detail: >-
                      Only organization owners and admins can manage
                      applications.
                Suspended:
                  summary: تم تعليق العضوية
                  value:
                    detail: Your access to this organization is suspended.
                MissingToken:
                  summary: لا يوجد رأس Authorization
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            المؤسسة غير موجودة أو أنك لست عضواً فيها، أو أن التطبيق غير موجود في
            تلك المؤسسة.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                OrganizationNotFound:
                  summary: المؤسسة غير موجودة، أو أنك لست عضواً فيها
                  value:
                    detail: Organization not found.
                ApplicationNotFound:
                  summary: لا يوجد تطبيق كهذا في هذه المؤسسة
                  value:
                    detail: Application not found.
        '503':
          description: >-
            فقط عندما يختار التحديث موقع بيانات آخر للتطبيق في بيئة الإنتاج الذي
            تم إنشاؤه مع مؤسستك: تعذر على Didit تأكيد أن التطبيق لا يحتوي على
            جلسة تحقق حتى الآن، لذلك لم يتم تغيير أي شيء. أعد محاولة الطلب.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
              examples:
                DataLocationCheckUnavailable:
                  value:
                    detail: >-
                      We couldn't confirm that this application is unused. Try
                      again in a moment.
                    code: data_location_check_unavailable
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X PATCH
            "https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/$APP_ID/"
            \
              -H "Authorization: Bearer $ACCESS_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "name": "Acme Production App",
                "website_url": "https://app.acme.example"
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Use the access token that account.login returns.
            client = Didit(account_token="YOUR_ACCESS_TOKEN")

            result = client.account.applications.update(
                "a1b2c3d4-5678-90ab-cdef-111111111111",
                "b2c3d4e5-6789-01bc-defg-222222222222",
                name="Acme Production App",
                website_url="https://app.acme.example",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Use the access token that account.login returns.
            const didit = new Didit({ accountToken: "YOUR_ACCESS_TOKEN" });

            const result = await didit.account.applications.update(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222",
              {
                name: "Acme Production App",
                website_url: "https://app.acme.example",
              },
            );
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Use the access token that account.login returns.\nclient := didit.NewClient(option.WithAccountToken(\"YOUR_ACCESS_TOKEN\"))\n\nresult, err := client.Account.Applications.Update(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\", didit.ApplicationUpdateRequest{\n\tName:       didit.String(\"Acme Production App\"),\n\tWebsiteURL: didit.String(\"https://app.acme.example\"),\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.ApplicationUpdateRequest;


            // Use the access token that account.login returns.

            Didit client =
            Didit.builder().accountToken("YOUR_ACCESS_TOKEN").build();


            var result =
            client.account().applications().update("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222",
            ApplicationUpdateRequest.builder()
                    .name("Acme Production App")
                    .websiteUrl("https://app.acme.example")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Use the access token that account.login returns.

            $didit = new DiditClient(accountToken: 'YOUR_ACCESS_TOKEN');


            $result =
            $didit->account->applications->update('a1b2c3d4-5678-90ab-cdef-111111111111',
            'b2c3d4e5-6789-01bc-defg-222222222222', [
                'name' => 'Acme Production App',
                'website_url' => 'https://app.acme.example',
            ]);

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

            # Use the access token that account.login returns.
            didit = Didit::Client.new(account_token: "YOUR_ACCESS_TOKEN")

            result = didit.account.applications.update(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222",
              name: "Acme Production App",
              website_url: "https://app.acme.example"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Use the access token that account.login returns.

            using var client = new DiditClient(new DiditClientOptions {
            AccountToken = "YOUR_ACCESS_TOKEN" });


            var result = await
            client.Account.Applications.UpdateAsync("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222", new ApplicationUpdateRequest

            {
                Name = "Acme Production App",
                WebsiteUrl = "https://app.acme.example",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    ApplicationUpdateRequest:
      type: object
      description: >-
        جسم PATCH للبيانات الوصفية للتطبيق. أرسل الحقول التي تريد تغييرها فقط؛
        ويتم الاحتفاظ بالحقول التي لم تُذكر. لا يمكن تحديث `uuid` و`client_id`
        و`api_key`. الحقل `products` للقراءة فقط: يتم تجاهل مفتاح `products` في
        الجسم. لا يمكن تغيير `data_location` بعد إنشاء التطبيق: يُقبل تحديد
        الموقع الذي يملكه بالفعل، وأي موقع آخر يُرجع 400. الاستثناء الوحيد هو
        تطبيق الإنتاج المنشأ مع مؤسستك: يحدد التحديث الأول الذي يذكر
        `data_location` موقعه، لمرة واحدة، طالما لم يتم استخدام أي مفتاح API
        للتطبيق ولا توجد له أي جلسة تحقق.
      properties:
        name:
          type: string
          description: اسم عرض التطبيق.
          example: Acme Production App
        website_url:
          type: string
          description: رابط الموقع الإلكتروني أو التطبيق المرتبط بهذا التطبيق.
          example: https://app.acme.example
        redirect_uris:
          type: array
          items:
            type: string
          description: >-
            عناوين URI المسموح بإعادة التوجيه إليها لمسارات إعادة توجيه التحقق
            وتلك الشبيهة بـ OAuth.
          example:
            - https://acme.example/callback
        terms_url:
          type: string
          description: رابط شروط الخدمة المعروض في مسار التحقق.
        privacy_url:
          type: string
          description: رابط سياسة الخصوصية المعروض في مسار التحقق.
        description:
          type: string
          description: وصف داخلي للتطبيق.
        data_location:
          $ref: '#/components/schemas/ApplicationDataLocation'
    Application:
      type: object
      description: >-
        سجل التطبيق الكامل. لا يتغير كل من `uuid` و`client_id` و`api_key` أبداً
        بعد الإنشاء. ولا يتغير `data_location` أيضاً، باستثناء مرة واحدة في
        التطبيق المباشر المنشأ مع مؤسستك، قبل استخدامه (راجع طلب التحديث).
      properties:
        uuid:
          type: string
          format: uuid
          description: معرّف UUID للتطبيق. يُستخدم كـ `{app_id}` في الاستدعاءات اللاحقة.
          example: b2c3d4e5-6789-01bc-defg-222222222222
        name:
          type: string
          description: اسم عرض التطبيق الذي يظهر في وحدة تحكم Didit.
          example: Acme Production App
        client_id:
          type: string
          description: معرّف عميل عام، آمن للتضمين في مسارات نمط OAuth.
          example: S9LIYGSoWNuGMLHsvEt9dQ
        api_key:
          type: string
          description: >-
            سر طويل الأجل (يُسمى أيضاً `client_secret`). يُستخدم كترويسة
            `x-api-key` لكل استدعاء إلى `https://verification.didit.me/v3/...`
            (الجلسات، وسير العمل، وفحص AML، وما إلى ذلك). تعامل معه كبيانات
            اعتماد؛ ولا تكشفه أبداً من جانب العميل. تبدأ المفاتيح الجديدة بـ
            `sk_live_` (تطبيق الإنتاج) أو `sk_test_` (تطبيق البيئة التجريبية)،
            متبوعة بـ 43 حرفاً آمناً لعنوان URL (أحرف، وأرقام، و `-`، و `_`).
            المفاتيح التي تم إنشاؤها قبل هذا التنسيق لا تحتوي على بادئة وتستمر
            في العمل دون تغيير. لمدة 72 ساعة بعد استرداد حسابك، تُرجع عمليات
            الإدراج والاسترداد والتحديث سلسلة فارغة هنا بدلاً من المفتاح.
          example: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        website_url:
          type: string
          nullable: true
          description: رابط الموقع الإلكتروني أو التطبيق المرتبط بهذا التطبيق.
          example: https://acme.example
        redirect_uris:
          type: array
          items:
            type: string
          description: >-
            عناوين URI المسموح بإعادة التوجيه إليها لمسارات إعادة توجيه التحقق
            وتلك الشبيهة بـ OAuth.
          example:
            - https://acme.example/callback
        terms_url:
          type: string
          nullable: true
          description: رابط شروط الخدمة المعروض في مسار التحقق.
          example: https://acme.example/terms
        privacy_url:
          type: string
          nullable: true
          description: رابط سياسة الخصوصية المعروض في مسار التحقق.
          example: https://acme.example/privacy
        description:
          type: string
          nullable: true
          description: وصف داخلي للتطبيق (لا يظهر للمستخدمين النهائيين).
        created_at:
          type: string
          format: date-time
          example: '2025-06-01T10:00:00Z'
        data_location:
          $ref: '#/components/schemas/ApplicationDataLocation'
        products:
          type: array
          readOnly: true
          description: >-
            منتجات التطبيق. دائماً جميع المنتجات الثلاثة، بهذا الترتيب:
            `identity`، `transactions`، `authentication`. يحتوي التطبيق الجديد
            على `identity` مفعّلاً مع تشغيل كل وحدة، و`transactions`
            و`authentication` معطّلين. للقراءة فقط: يتم تجاهل مفتاح `products`
            في نص إنشاء أو تحديث.
          items:
            $ref: '#/components/schemas/ApplicationProduct'
          example:
            - product: identity
              status: enabled
              modules:
                user_verification: true
                business_verification: true
                case_management: true
            - product: transactions
              status: disabled
              modules:
                travel_rule: true
                case_management: true
            - product: authentication
              status: disabled
              modules: {}
    ValidationError:
      description: >-
        جسم خطأ التحقق من الصحة. الغلاف المقصود هو خريطة `{field: ["message",
        ...]}` للأخطاء على مستوى الحقول أو غلاف بمفتاح فردي `{detail: "..."}`
        لأخطاء قواعد العمل. هناك عدد قليل من أدوات التحقق (قوة كلمة المرور عند
        التسجيل، وصلاحية الرمز عند verify-email) تستجيب حالياً بمصفوفة مجردة
        `["message"]` -- وهو تعارض معروف من جانب الخادم. يحتفظ المخطط أدناه بفرع
        المصفوفة المجردة حتى تتمكن التعليمات البرمجية للعميل المنشأة من هذه
        المواصفة من إلغاء تسلسل استجابات اليوم، ولكن يجب أن تعامل التعليمات
        البرمجية الجديدة للعميل هذه الاستجابة بالشكل المخصص للحقل المعني
        (`{password: [...]}` أو `{code: [...]}`) وسيتقارب عقد الخادم مع هذا
        الشكل.
      oneOf:
        - type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            email:
              - Enter a valid email address.
        - type: object
          properties:
            detail:
              type: string
          example:
            detail: An account with this email already exists.
        - type: array
          items:
            type: string
          example:
            - Invalid or expired verification code.
    AuthError:
      type: object
      description: غلاف خطأ المصادقة / التفويض / غير موجود.
      properties:
        detail:
          type: string
          example: Invalid access token
    ServiceUnavailableError:
      type: object
      description: >-
        تعذر إكمال الطلب في الوقت الحالي ولم يتغير أي شيء. أعد المحاولة بعد
        لحظات.
      properties:
        detail:
          type: string
          example: >-
            We couldn't confirm that this application is unused. Try again in a
            moment.
        code:
          type: string
          example: data_location_check_unavailable
    ApplicationDataLocation:
      type: string
      enum:
        - eu
        - au
        - mx
      description: >-
        مكان تخزين ومعالجة بيانات التحقق الخاصة بالتطبيق، ويتم اختياره عند إنشاء
        التطبيق. القيمة `eu` هي الاتحاد الأوروبي (أيرلندا)، وهو الخيار
        الافتراضي. ستتوفر قيمتا `au` (أستراليا، سيدني) و`mx` (المكسيك) قريباً:
        أي طلب يحددهما يُرجع استجابة 400 `This data location is not available
        yet.`. يكون تطبيق البيئة التجريبية للمؤسسة دائماً في الاتحاد الأوروبي.
      example: eu
    ApplicationProduct:
      type: object
      description: >-
        منتج واحد خاص بتطبيق وحالته. للقراءة فقط: تُرجعه endpoints الخاصة
        بالتطبيق وتتجاهله في متن الطلب.
      properties:
        product:
          type: string
          enum:
            - identity
            - transactions
            - authentication
          description: >-
            `identity` (التحقق من الهوية)، أو `transactions` (مراقبة المعاملات)،
            أو `authentication` (المصادقة).
          example: identity
        status:
          type: string
          enum:
            - enabled
            - early_access
            - disabled
          description: >-
            ما إذا كان المنتج مفعلاً لهذا التطبيق. ينطبق `early_access` فقط على
            `authentication`، والتي تفعلها Didit لك.
          example: enabled
        modules:
          type: object
          additionalProperties:
            type: boolean
          description: >-
            مفاتيح تبديل وحدات المنتج، وتكون كل منها إما `true` أو `false`.
            يحتوي `identity` على `user_verification` و `business_verification` و
            `case_management`. ويحتوي `transactions` على `travel_rule` و
            `case_management`. ولا يحتوي `authentication` على أي منها (`{}`). إن
            `case_management` هو إعداد واحد يظهر تحت كل من `identity` و
            `transactions`، لذا فإنه يحمل نفس القيمة في كليهما.
          example:
            user_verification: true
            business_verification: true
            case_management: true
      required:
        - product
        - status
        - modules
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        رمز `access_token` بصيغة JWT موقّع باستخدام RS256 ومُرجع بواسطة `POST
        /programmatic/login/` أو `POST /programmatic/verify-email/`. يُرسل كـ
        `Authorization: Bearer <access_token>`. مدة الصلاحية الافتراضية هي 86400
        ثانية (24 ساعة). هذا الـ token صالح فقط مقابل نقاط endpoint لإدارة
        الحسابات على `apx.didit.me/auth/v2`. تستخدم API التحقق
        (`verification.didit.me/v3`) الـ `api_key` طويل الأجل كـ `x-api-key`
        بدلاً من ذلك.

````

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