> ## Documentation Index
> Fetch the complete documentation index at: https://docs.truthlocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# الحالة البرمجية

> استعلام عن حالة الخدمة في الوقت الفعلي لجميع خدمات Truthlocks. لا يلزم المصادقة.

يعرض حالة الصحة الحالية لكل خدمة من خدمات Truthlocks. استخدم نقطة النهاية هذه لدمج توفر الخدمة في لوحات المعلومات الخاصة بك، أو خطوط تنبيهك، أو قواطع الدائرة.

يتم تقديم نقطة النهاية هذه من `status.truthlocks.com`، وليس من واجهة برمجة التطبيقات الرئيسية. لا يلزم المصادقة.

```http theme={null}
GET https://status.truthlocks.com/api/health
```

### حقول الاستجابة

| الحقل | النوع | الوصف |
| - | - | - |
| `status` | string | الصحة العامة للنظام: `operational`، `degraded`، أو `outage`. |
| `timestamp` | string | طابع زمني بتنسيق ISO 8601 للتحقق. |
| `services` | array | نتائج صحة كل خدمة. |
| `services[].id` | string | معرّف الخدمة القابل للقراءة آليًا (مثل `api-gateway`، `signing-service`). |
| `services[].name` | string | اسم الخدمة المقروء بشريًا. |
| `services[].status` | string | صحة الخدمة: `operational`، `degraded`، أو `outage`. |
| `services[].responseTime` | number or null | وقت الاستجابة بالمللي ثانية، أو `null` إذا كان غير قابل للوصول. |
| `services[].error` | string | موجود فقط عندما تكون الخدمة غير عاملة. يصف سبب الفشل. |

### منطق الحالة

* **`operational`** — جميع الخدمات سليمة وتستجيب بشكل طبيعي.
* **`degraded`** — خدمة واحدة على الأقل بطيئة أو تُرجع أخطاء، ولكن لا توجد أي خدمة معطلة تمامًا.
* **`outage`** — خدمة واحدة على الأقل غير قابلة للوصول تمامًا.

### الخدمات المراقبة

| معرف الخدمة | الاسم | الوصف |
| - | - | - |
| `api-gateway` | بوابة API | نقطة نهاية API الرئيسية لجميع الطلبات العامة |
| `trust-registry` | سجل الثقة | إدارة وحوكمة المُصدر |
| `billing-service` | الفوترة | معالجة الاشتراكات والمدفوعات |
| `signing-service` | التوقيع | عمليات التوقيع التشفيري |
| `attestation-service` | شهادات | سك وصيانة الشهادات |
| `audit-service` | سجلات التدقيق | تسجيل الأنشطة والامتثال |
| `transparency-log` | سجل الشفافية | سجل إلحاقي تشفيري فقط |
| `verification-service` | التحقق | التحقق من حزمة الإثبات |

### مثال: حالة الاستقصاء من تطبيقك

```javascript theme={null}
async function checkTruthlockStatus() {
  const res = await fetch("https://status.truthlocks.com/api/health");
  const data = await res.json();

  if (data.status !== "operational") {
    console.warn(`Truthlocks is ${data.status}`);
    const issues = data.services.filter((s) => s.status !== "operational");
    issues.forEach((s) =>
      console.warn(`  ${s.name}: ${s.status} — ${s.error}`)
    );
  }

  return data;
}
```

### مثال: فحص ما قبل الإصدار قبل السك

```javascript theme={null}
async function mintWithStatusCheck(attestation) {
  const status = await fetch("https://status.truthlocks.com/api/health");
  const health = await status.json();

  const signingService = health.services.find(
    (s) => s.id === "signing-service"
  );
  const attestationService = health.services.find(
    (s) => s.id === "attestation-service"
  );

  if (
    signingService?.status !== "operational" ||
    attestationService?.status !== "operational"
  ) {
    throw new Error("Required services are not operational — retry later");
  }

  return client.attestations.mint(attestation);
}
```

> [!NOTE]
>
> تخضع نقطة النهاية هذه لقيود المعدل لمنع إساءة الاستخدام. للمراقبة المستمرة، استطلع
> ليس أكثر تكرارًا من مرة واحدة كل 30 ثانية.


## OpenAPI

````yaml ar/mint-openapi.yaml GET /api/health
openapi: 3.0.3
info:
  title: Truthlocks API
  description: >
    Truthlocks هي بنية تحتية عالمية للتحقق من المستندات وبيانات الاعتماد والأصول
    الرقمية.يحدد هذا المواصفات واجهة برمجة التطبيقات (API) الأساسية للتفاعل مع
    خدمات Truthlocks.


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

    - **الإنتاج**: `https://api.truthlocks.com`

    - **البيئة التجريبية (Sandbox)**: `https://sandbox-api.truthlocks.com`


    ## المصادقة

    - **مفاتيح API**: استخدم رأس `X-API-Key` للعمليات من جهاز إلى جهاز

    - **رموز Bearer**: استخدم `Authorization: Bearer <jwt>` للعمليات التي يبدأها
    المستخدم


    ## هوية المستأجر

    في بيئة الإنتاج، تُستمد هوية المستأجر من السياق المصادق عليه (مفتاح API أو
    JWT).

    يتم تجاهل رأس `X-Tenant-ID` في بيئة الإنتاج لمنع الانتحال.
  version: 1.0.0
  contact:
    name: Truthlocks Support
    url: https://truthlocks.com/support
    email: support@truthlocks.com
servers:
  - url: https://api.truthlocks.com
    description: واجهة برمجة تطبيقات الإنتاج
  - url: https://sandbox-api.truthlocks.com
    description: بيئة اختبار (Sandbox)
security:
  - APIKey: []
  - BearerAuth: []
tags:
  - name: Authentication
    description: إدارة مفاتيح ورموز API
  - name: Issuers
    description: تسجيل المصدر وإدارة الثقة
  - name: Keys
    description: إدارة المفاتيح التشفيرية لجهات الإصدار
  - name: Attestations
    description: دورة حياة الإشهاد (السك، الإلغاء، الاستبدال)
  - name: Verification
    description: حزم التحقق والإثبات للإشهاد
  - name: Governance
    description: سير عمل حوكمة المصدر (للمسؤول فقط)
  - name: Identity
    description: إدارة المنظمة والمستخدمين والأدوار
  - name: Audit
    description: استعلامات أحداث التدقيق
  - name: Tenant Console
    description: ملف تعريف المستأجر ونقاط نهاية دورة الحياة
  - name: Health
    description: نقاط نهاية صحة الخدمة وجاهزيتها
  - name: Risk
    description: استيعاب إشارة المخاطر واكتشاف الاحتيال
  - name: Risk Enforcement
    description: إجراءات إنفاذ المخاطر — الحظر والتحدي والحجر والتكوين
  - name: Billing
    description: إدارة الفوترة والاشتراكات والإضافات
  - name: Machine Identity
    description: >-
      بروتوكول هوية وكيل الآلة (MAIP) — تسجيل الوكيل، الجلسات، الثقة، الشهادة،
      الامتثال، التنسيق، والمراقبة
externalDocs:
  description: واجهة برمجة تطبيقات الشفافية للقراءة فقط (مواصفات خدمة منفصلة)
  url: >-
    https://github.com/truthlocks/truthlock/blob/main/docs/transparency/openapi.yaml
paths:
  /api/health:
    get:
      tags:
        - Health
      summary: الحالة البرمجية
      description: >-
        يعرض حالة الخدمة في الوقت الفعلي لجميع خدمات Truthlocks. لا يلزم
        المصادقة.
      operationId: health.status
      responses:
        '200':
          description: صحة الخدمة
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - operational
                      - degraded
                      - outage
                  timestamp:
                    type: string
                    format: date-time
                  services:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                        status:
                          type: string
                        responseTime:
                          nullable: true
                          type: integer
                        lastChecked:
                          type: string
                          format: date-time
                        error:
                          type: string
                          description: يظهر عندما يبلغ فحص الصحة عن فشل.
      security: []
      servers:
        - url: https://status.truthlocks.com
components:
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: مفتاح API للمصادقة من جهاز إلى جهاز
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT للعمليات التي يبدأها المستخدم

````

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