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

# إنشاء تطبيق عبر API: التطبيقات البرمجية

> أنشئ تطبيق Didit واحدًا لكل عميل أو علامة تجارية أو بيئة أو وحدة أعمال عبر POST /organizations/me/{org_id}/applications/. يعيد client_id وapi_key.



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



      
      

\<pre>

\`Create a new Didit application inside one of your organizations — each application has its own client_id and api_key, isolating sessions, webhooks, branding, and billing from sibling applications.

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

Authentication:
Authorization: Bearer <access_token>
The access token must belong to an OWNER or ADMIN of the target organization. Get one via POST /programmatic/login/ or POST /programmatic/verify-email/.

Path parameter:
\- org_id (UUID, required) — Organization that will own the new application. Discover yours via GET /organizations/me/.

Request body (ALL fields optional — omit the body to get a default-named app):
\- name (string, optional) — Display name. Defaults to "<organization name> App".
\- website_url (string, URL, optional) — Public homepage shown in the verification flow.
\- redirect_uris (array of strings, optional) — Allowlisted OAuth-style redirect URIs.
\- terms_url (string, URL, optional) — Terms-of-service link shown in the verification UI.
\- privacy_url (string, URL, optional) — Privacy policy link shown in the verification UI.
\- description (string, optional) — Internal note. Not shown to end users.
\- data_location (string, optional) — Where the application's verification data is stored and processed: "eu" (European Union, Ireland), the default. "au" (Australia, Sydney) and "mx" (Mexico) are coming soon and answer 400 today. Chosen once: it can't be changed after the application is created.

When to call:
\- Resellers — one application per end customer to fully isolate credentials, branding, webhooks, and billing.
\- Multi-brand / multi-product — one application per brand, product, region, or environment (dev / staging / prod).
\- Use-case separation — e.g. one application for ID + selfie KYC, another for AML screening only.

curl example:
curl -X POST "https://apx.didit.me/auth/v2/organizations/me/<ORG_ID>/applications/" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Customer App",
"website_url": "https://acme.example",
"redirect_uris": ["https://acme.example/callback"],
"terms_url": "https://acme.example/terms",
"privacy_url": "https://acme.example/privacy",
"data_location": "eu"
}'

Response (201 Created):
\{
"uuid": "b2c3d4e5-6789-...",
"name": "Acme Customer App",
"client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
"api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"website_url": "https://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": {} }
]
}

What to do with the response:
\- PERSIST api_key SECURELY — use it as the x-api-key header on every https://verification.didit.me/v3/... call (sessions, workflows, billing).
\- Persist uuid (app_id) — required for /organizations/me/{org_id}/applications/{app_id}/ reads and updates.
\- If you lose the api_key, recover it later via GET /organizations/me/{org_id}/applications/{app_id}/ — see /auth-api/get-credentials.
\- products is read-only and always lists identity, transactions and authentication in that order. A new application has identity enabled with every module on, and transactions and authentication disabled. A products key in the request body is ignored.

Failure modes:
\- 400 — { "<field>": ["Enter a valid URL."] } for malformed website_url / redirect_uris / terms_url / privacy_url.
\- 400 — { "data_location": ["This data location is not available yet."] } for "au" or "mx", and { "data_location": ["\\"us\\" is not a valid choice."] } for a location that does not exist. Nothing is created.
\- 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.

Next steps:
\- Configure a workflow inside the new application via POST /v3/workflows/ — see /management-api/workflows/create.
\- Update application metadata later via PATCH /organizations/me/{org_id}/applications/{app_id}/ — see /auth-api/update-application.

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

\</pre>



      
      

الصق في

استخدم نقطة النهاية هذه عندما تحتاج إلى فصل حركة التحقق أو بيانات الاعتماد أو العلامة التجارية أو إعداد التقارير داخل المؤسسة نفسها.وهي مفيدة بشكل خاص لـ**وكلاء إعادة البيع** الذين ينشئون تطبيقاً واحداً لكل عميل. كما أنها تناسب الشركات التي تملك عدة منتجات أو علامات تجارية أو مناطق، أو بيئات اختبار وإنتاج، أو حالات استخدام لا ينبغي أن تشترك في مفتاح API نفسه والإعدادات على مستوى التطبيق.> [!NOTE]
>
> تستخدم جميع endpoint الخاصة بـ Auth API المسار `https://apx.didit.me/auth/v2`. استخدم `api_key` المُعاد كقيمة للرأس `x-api-key` عند استدعاء endpoint الخاصة بـ `https://verification.didit.me/v3/...` مثل الجلسات وسير العمل.## موقع البياناتيخزّن كل تطبيق بيانات التحقق ويعالجها في موقع واحد، هو موقع البيانات الخاص به، ويُختار عند إنشائه باستخدام الحقل `data_location`.
الموقع المتاح حالياً هو `eu`، أي الاتحاد الأوروبي (أيرلندا)، وهو القيمة الافتراضية عند عدم تضمين الحقل.
ستتوفر أستراليا (سيدني، `au`) والمكسيك (`mx`) قريباً: الطلب الذي يحدد أحدهما يستجيب بالرمز 400 مع الرسالة `This data location is not available yet.` ولا يُنشئ شيئاً.
كل قراءة للتطبيق تُعيد `data_location` الخاص به، ولا يمكن تغييره بعد إنشاء التطبيق.
راجع [موقع البيانات](https://docs.didit.me/ar/console/applications.md#موقع-البيانات).


## OpenAPI

````yaml ar/openapi-auth.json POST /organizations/me/{org_id}/applications/
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/:
    post:
      tags:
        - Account Management
      summary: إنشاء تطبيق
      description: >-
        أنشئ تطبيقاً داخل مؤسسة، في موقع البيانات الذي تختاره (`data_location`،
        وهو الاتحاد الأوروبي افتراضياً؛ ولا يمكن تغييره بعد ذلك). تتضمن
        الاستجابة `api_key`؛ احفظه الآن (يمكن استرداده عبر GET). يتطلب ذلك JWT
        لمالك/مسؤول.
      operationId: create_organization_application
      parameters:
        - name: org_id
          in: path
          required: true
          description: معرّف UUID للمؤسسة. ابحث عنه باستخدام `GET /organizations/me/`.
          schema:
            type: string
            format: uuid
            example: a1b2c3d4-5678-90ab-cdef-111111111111
      requestBody:
        required: false
        description: >-
          جميع الحقول اختيارية. يؤدي حذف payload إلى إنشاء تطبيق بالاسم
          الافتراضي `"<organization name> App"` وبدون عناوين URL عامة مهيأة.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplicationCreateRequest'
            examples:
              ResellerCustomer:
                summary: موزع ينشئ تطبيقاً مخصصاً للعميل
                value:
                  name: Acme Customer App
                  website_url: https://acme.example
                  redirect_uris:
                    - https://acme.example/callback
                  terms_url: https://acme.example/terms
                  privacy_url: https://acme.example/privacy
                  data_location: eu
              Minimal:
                summary: إنشاء بالحد الأدنى -- قبول كافة الإعدادات الافتراضية
                value:
                  name: Sandbox App
              Empty:
                summary: >-
                  لا يوجد متن على الإطلاق -- يُعيَّن افتراضياً إلى تطبيق <اسم
                  المؤسسة>
                value: {}
      responses:
        '201':
          description: >-
            تم إنشاء التطبيق. تتضمن الاستجابة `api_key` طويل الأجل؛ احفظه الآن
            واستخدمه كرأس `x-api-key` في كل استدعاء لـ
            `https://verification.didit.me/v3/...`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Success:
                  value:
                    uuid: b2c3d4e5-6789-01bc-defg-222222222222
                    name: Acme Customer App
                    client_id: S9LIYGSoWNuGMLHsvEt9dQ
                    api_key: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    website_url: https://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: >-
            خطأ في التحقق من الصحة في نص الطلب: على سبيل المثال عنوان URI لإعادة
            التوجيه غير صحيح التنسيق، أو `data_location` غير متوفر بعد (`au`،
            `mx`) أو غير موجود. لم يتم إنشاء أي شيء.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                InvalidUrl:
                  value:
                    website_url:
                      - Enter a valid URL.
                DataLocationNotAvailable:
                  summary: موقع بيانات سيتوفر قريباً
                  value:
                    data_location:
                      - This data location is not available yet.
                UnknownDataLocation:
                  summary: موقع بيانات غير موجود
                  value:
                    data_location:
                      - '"us" is not a valid choice.'
        '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.` ولمدة 72 ساعة بعد
            استرداد حسابك، يتم رفض الطلب مع الرمز `code` `recovery_hold`
            و`until`، وهو وقت انتهاء التعليق.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/AuthError'
                  - $ref: '#/components/schemas/RecoveryHoldError'
              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.
                RecoveryHold:
                  summary: تمت استعادة الحساب منذ أقل من 72 ساعة
                  value:
                    detail: This action is on hold because you recovered your account.
                    code: recovery_hold
                    until: '2026-11-04T10:15:00+00:00'
        '404':
          description: المؤسسة غير موجودة أو أنك لست عضواً فيها.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              examples:
                OrganizationNotFound:
                  summary: المؤسسة غير موجودة، أو أنك لست عضواً فيها
                  value:
                    detail: Organization not found.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/"
            \
              -H "Authorization: Bearer $ACCESS_TOKEN" \
              -H "Content-Type: application/json" \
              -d '{
                "name": "Acme Customer App",
                "website_url": "https://acme.example",
                "redirect_uris": ["https://acme.example/callback"],
                "data_location": "eu"
              }'
        - 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.create(
                "a1b2c3d4-5678-90ab-cdef-111111111111",
                name="Acme Customer App",
                website_url="https://acme.example",
                redirect_uris=["https://acme.example/callback"],
                terms_url="https://acme.example/terms",
                privacy_url="https://acme.example/privacy",
                data_location="eu",
            )
            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.create("a1b2c3d4-5678-90ab-cdef-111111111111",
            {
              name: "Acme Customer App",
              website_url: "https://acme.example",
              redirect_uris: ["https://acme.example/callback"],
              terms_url: "https://acme.example/terms",
              privacy_url: "https://acme.example/privacy",
              data_location: "eu",
            });

            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.Create(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", didit.ApplicationCreateRequest{\n\tName:         didit.String(\"Acme Customer App\"),\n\tWebsiteURL:   didit.String(\"https://acme.example\"),\n\tRedirectURIs: didit.Some([]string{\"https://acme.example/callback\"}),\n\tTermsURL:     didit.String(\"https://acme.example/terms\"),\n\tPrivacyURL:   didit.String(\"https://acme.example/privacy\"),\n\tDataLocation: didit.Some(didit.ApplicationDataLocation(\"eu\")),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.ApplicationCreateRequest;

            import me.didit.types.ApplicationDataLocation;


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

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


            var result =
            client.account().applications().create("a1b2c3d4-5678-90ab-cdef-111111111111",
            ApplicationCreateRequest.builder()
                    .name("Acme Customer App")
                    .websiteUrl("https://acme.example")
                    .redirectUris(List.of("https://acme.example/callback"))
                    .termsUrl("https://acme.example/terms")
                    .privacyUrl("https://acme.example/privacy")
                    .dataLocation(ApplicationDataLocation.of("eu"))
                    .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->create('a1b2c3d4-5678-90ab-cdef-111111111111',
            [
                'name' => 'Acme Customer App',
                'website_url' => 'https://acme.example',
                'redirect_uris' => ['https://acme.example/callback'],
                'terms_url' => 'https://acme.example/terms',
                'privacy_url' => 'https://acme.example/privacy',
                'data_location' => 'eu',
            ]);

            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.create(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              name: "Acme Customer App",
              website_url: "https://acme.example",
              redirect_uris: ["https://acme.example/callback"],
              terms_url: "https://acme.example/terms",
              privacy_url: "https://acme.example/privacy",
              data_location: "eu"
            )
            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.CreateAsync("a1b2c3d4-5678-90ab-cdef-111111111111",
            new ApplicationCreateRequest

            {
                Name = "Acme Customer App",
                WebsiteUrl = "https://acme.example",
                RedirectUris = new string[] { "https://acme.example/callback" },
                TermsUrl = "https://acme.example/terms",
                PrivacyUrl = "https://acme.example/privacy",
                DataLocation = new ApplicationDataLocation("eu"),
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    ApplicationCreateRequest:
      type: object
      description: >-
        جميع الحقول اختيارية. يؤدي إرسال payload فارغ إلى إنشاء تطبيق باسم
        افتراضي في الاتحاد الأوروبي.
      properties:
        name:
          type: string
          description: اسم عرض التطبيق. القيمة الافتراضية هي `"<organization name> App"`.
          example: Acme Customer App
        website_url:
          type: string
          description: رابط الموقع الإلكتروني أو التطبيق المرتبط بهذا التطبيق.
          example: https://acme.example
        redirect_uris:
          type: array
          items:
            type: string
          description: >-
            عناوين URI المسموح بإعادة التوجيه إليها لمسارات إعادة توجيه التحقق
            وتلك الشبيهة بـ OAuth.
          example:
            - https://acme.example/callback
        terms_url:
          type: string
          description: رابط شروط الخدمة المعروض في مسار التحقق.
          example: https://acme.example/terms
        privacy_url:
          type: string
          description: رابط سياسة الخصوصية المعروض في مسار التحقق.
          example: https://acme.example/privacy
        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
    RecoveryHoldError:
      type: object
      description: >-
        يتم إرجاعها لمدة 72 ساعة بعد استرداد الحساب (تمت إعادة تعيين طرق تسجيل
        الدخول المفقودة). تُرفض الإجراءات التي تنشئ مؤسسات أو تطبيقات أو أسراراً
        حتى `until`؛ بينما تستمر عمليات القراءة في العمل.
      required:
        - detail
        - code
        - until
      properties:
        detail:
          type: string
          example: This action is on hold because you recovered your account.
        code:
          type: string
          enum:
            - recovery_hold
          example: recovery_hold
        until:
          type: string
          format: date-time
          description: وقت انتهاء فترة التعليق (ISO 8601). أعد محاولة الطلب بعد هذا الوقت.
          example: '2026-11-04T10:15:00+00:00'
    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.