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

# الحصول على client_id و api_key عبر واجهة API

> احصل على client_id وapi_key لتطبيق Didit الخاص بك عبر GET. استخدم api_key كرأس x-api-key في جميع طلبات واجهات التحقق. تسعير حسب الاستخدام، دون عقود.



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



      
      

\<pre>

\`Read one application's full record — including its client_id and api_key (client_secret). Use this to RECOVER an api_key you've misplaced.

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

Authentication:
Authorization: Bearer <access_token>
Get a token via POST /programmatic/login/.

Path parameters:
\- org_id (UUID, required) — Organization that owns the application. Get via GET /organizations/me/.
\- app_id (UUID, required) — Application UUID. Returned by POST /programmatic/verify-email/ (in the application.uuid field), by POST /organizations/me/{org_id}/applications/, or visible in the Didit console.

curl example:
curl "https://apx.didit.me/auth/v2/organizations/me/<ORG_ID>/applications/<APP_ID>/" \
-H "Authorization: Bearer <ACCESS_TOKEN>"

Response (200 OK):
\{
"uuid": "b2c3d4e5-6789-...",
"name": "My App",
"client_id": "S9LIYGSoWNuGMLHsvEt9dQ",
"api_key": "sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"website_url": "https://example.com",
"redirect_uris": ["https://example.com/callback"],
"terms_url": "https://example.com/terms",
"privacy_url": "https://example.com/privacy",
"description": "Production application",
"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": {} }
]
}

How to use the response:
\- api_key → set as the x-api-key header on EVERY call to https://verification.didit.me/v3/... (sessions, workflows, questionnaires, AML monitoring, billing, etc.).
\- client_id → shown alongside api_key for OAuth-style introspection scenarios. Routine verification calls only need api_key.
\- data_location → where the application's verification data is stored and processed: "eu" (European Union, Ireland). Chosen when the application is created; "au" (Australia, Sydney) and "mx" (Mexico) are coming soon.
\- products → read-only. Always all three products in this order: identity, transactions, authentication. Each has a status (enabled, early_access or disabled) and its module switches (true or false). identity modules: user_verification, business_verification, case_management. transactions modules: travel_rule, case_management. authentication has none ({}).

Failure modes:
\- 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.

When to call:
\- After programmatic login from a new machine — you have an access_token but not the api_key, and you need x-api-key to start calling verification.didit.me.
\- Auditing your applications — list all apps with GET /organizations/me/{org_id}/applications/, then read each.

Note:
This endpoint does not rotate the credential. It returns the application's current api_key on every GET, so there is no "show api_key once" model.

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

\</pre>



      
      

الصق في



## OpenAPI

````yaml ar/openapi-auth.json GET /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}/:
    get:
      tags:
        - Account Management
      summary: الحصول على بيانات اعتماد التطبيق
      description: >-
        قراءة السجل الكامل لتطبيق واحد بما في ذلك `client_id` و`api_key`. استخدم
        هذا لاستعادة `api_key` مفقود.
      operationId: get_application_credentials
      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
      responses:
        '200':
          description: سجل التطبيق متضمناً `client_id` و`api_key` الخاصين به.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
              examples:
                Success:
                  value:
                    uuid: b2c3d4e5-6789-01bc-defg-222222222222
                    name: My App
                    client_id: S9LIYGSoWNuGMLHsvEt9dQ
                    api_key: sk_live_example_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                    website_url: https://example.com
                    redirect_uris:
                      - https://example.com/callback
                    terms_url: https://example.com/terms
                    privacy_url: https://example.com/privacy
                    description: Production application
                    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: {}
        '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.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl
            "https://apx.didit.me/auth/v2/organizations/me/$ORG_ID/applications/$APP_ID/"
            \
              -H "Authorization: Bearer $ACCESS_TOKEN"
        - 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.retrieve(
                "a1b2c3d4-5678-90ab-cdef-111111111111",
                "b2c3d4e5-6789-01bc-defg-222222222222",
            )
            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.retrieve(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222",
            );
            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.Retrieve(ctx, \"a1b2c3d4-5678-90ab-cdef-111111111111\", \"b2c3d4e5-6789-01bc-defg-222222222222\")\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;


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

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


            var result =
            client.account().applications().retrieve("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222");

            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->retrieve('a1b2c3d4-5678-90ab-cdef-111111111111',
            'b2c3d4e5-6789-01bc-defg-222222222222');

            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.retrieve(
              "a1b2c3d4-5678-90ab-cdef-111111111111",
              "b2c3d4e5-6789-01bc-defg-222222222222"
            )
            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.RetrieveAsync("a1b2c3d4-5678-90ab-cdef-111111111111",
            "b2c3d4e5-6789-01bc-defg-222222222222");

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    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: {}
    AuthError:
      type: object
      description: غلاف خطأ المصادقة / التفويض / غير موجود.
      properties:
        detail:
          type: string
          example: Invalid access token
    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.