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

# إنشاء فحص امتثال

> تشغيل فحص امتثال آلي مقابل لائحة لكيان

ينفذ تقييم امتثال آلي لكيان معين (وكيل، نموذج، مجموعة بيانات، أو سير عمل) مقابل لائحة مدعومة. يتحقق الفحص من تكوين الكيان، وأنماط الوصول، ومعالجة البيانات، ومسار التدقيق مقابل متطلبات اللائحة وينتج تحديد امتثال مع نتائج مفصلة.

فحوصات الامتثال متطابقة لنفس زوج الكيان-التنظيم ضمن نافذة 24 ساعة. تعيد المكالمات المتكررة ضمن تلك النافذة النتيجة المخزنة مؤقتًا.

### المصادقة

يتطلب رأس `X-API-Key` أو رمز Bearer JWT. يتم اشتقاق مساحة العمل من بيانات الاعتماد الموثقة؛ لا ترسل `X-Tenant-ID`.

### الاستجابة

**id** `string`

معرف فريد لسجل فحص الامتثال. التنسيق: `maip-cc:ULID`.

**entity\_type** `string`

نوع الكيان الذي تم تقييمه.

**entity\_id** `string`

معرف الكيان الذي تم تقييمه.

**regulation** `string`

اللائحة التي تم تقييمها.

**scope** `string`

نطاق التقييم. `full` إذا لم يتم تحديد نطاق.

**status** `string`

تحديد الامتثال. أحد الخيارات التالية: - `compliant` -- الكيان يفي بجميع
المتطلبات المقدرة - `non_compliant` -- الكيان يفشل في واحد أو أكثر من المتطلبات الحرجة
المتطلبات - `partial` -- الكيان يلبي بعض المتطلبات وليس كلها

**findings** `object[]`

قائمة مفصلة بالنتائج الفردية من التقييم.

**Finding fields**

**findings\[].control\_id** `string`

معرّف التحكم ضمن اللائحة (على سبيل المثال، `CC6.1` لـ SOC2، `A.9.1.1` لـ ISO27001).

**findings\[].control\_name** `string`

طابع زمني ISO 8601 لوقت حساب هذه النتيجة.

**findings\[].status** `string`

حالة هذا التحكم المحدد: `pass`، `fail`، `partial`، `not_applicable`.

**findings\[].severity** `string`

خطورة النتيجة إذا لم تكن ناجحة: `critical`، `high`، `medium`، `low`.

**findings\[].description** `string`

معدل السك الفعال لكل عملية بالسنوات بعد التعديل الإقليمي.

**receipt\_id** `string`

إيصال MAIP الذي تم سكه لفحص الامتثال هذا، مما يوفر إيصالًا غير قابل للتغيير
سجل التدقيق.

**checked\_at** `string`

طابع زمني ISO 8601 لتاريخ إجراء التقييم.

### اللوائح المدعومة

| اللائحة | الضوابط التي تم تقييمها | المدة النموذجية |
| :- | :- | :- |
| `SOC2` | معايير خدمة الثقة (CC1-CC9) | 2-5 ثوانٍ |
| `ISO27001` | ضوابط الملحق أ (A.5-A.18) | 2-5 ثوانٍ |
| `GDPR` | المواد 5، 6، 12-22، 25، 32-34 | 3-8 ثوانٍ |
| `HIPAA` | ضمانات إدارية، مادية، تقنية | 3-8 ثوانٍ |
| `EU_AI_ACT` | تصنيف المخاطر، الشفافية، الإشراف البشري | 5-10 ثوانٍ |


## OpenAPI

````yaml ar/mint-openapi.yaml POST /v1/compliance/check
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:
  /v1/compliance/check:
    post:
      tags:
        - Machine Identity
      summary: إنشاء فحص امتثال
      description: >-
        يبدأ فحص الامتثال لوكيل مقابل إطار تنظيمي محدد. يعيد النتائج مع تصنيفات
        الخطورة.
      operationId: maip.compliance.check
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                auditor_id:
                  type: string
                check_type:
                  type: string
                entity_id:
                  type: string
                entity_type:
                  type: string
                evidence_hash:
                  nullable: true
                  type: string
                metadata: {}
                notes:
                  type: string
                regulation:
                  type: string
                requirement_id:
                  type: string
                result:
                  type: string
                ttl_days:
                  type: integer
              type: object
              required:
                - entity_id
                - regulation
                - requirement_id
                - result
                - auditor_id
      responses:
        '201':
          description: تم إنشاء فحص الامتثال
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaipComplianceCheck'
        '400':
          description: خطأ في التحقق
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          description: المصادقة مطلوبة
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: تجاوز حد المعدل
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - APIKey: []
components:
  schemas:
    MaipComplianceCheck:
      type: object
      properties:
        check_id:
          type: string
          format: uuid
        agent_id:
          type: string
          format: uuid
        framework:
          type: string
          enum:
            - soc2
            - iso27001
            - hipaa
            - gdpr
        scope:
          type: object
          additionalProperties: true
        status:
          type: string
          enum:
            - pending
            - passed
            - failed
            - partial
        findings:
          type: array
          items:
            type: object
            properties:
              finding_id:
                type: string
              severity:
                type: string
                enum:
                  - low
                  - medium
                  - high
                  - critical
              title:
                type: string
              description:
                type: string
        created_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - code
        - message
        - http_status
      properties:
        code:
          type: string
          description: رمز خطأ قابل للقراءة آليًا
          enum:
            - AUTH_REQUIRED
            - AUTH_INVALID
            - PERMISSION_DENIED
            - TENANT_IDENTITY_UNVERIFIED
            - NOT_FOUND
            - VALIDATION_ERROR
            - CONFLICT
            - PAYLOAD_TOO_LARGE
            - RATE_LIMIT_EXCEEDED
            - QUOTA_EXCEEDED
            - SERVICE_UNAVAILABLE
            - INTERNAL_ERROR
        message:
          type: string
          description: رسالة خطأ مقروءة بشريًا
        http_status:
          type: integer
          description: رمز حالة HTTP
        retry_after_ms:
          type: integer
          description: عدد المللي ثانية للانتظار قبل إعادة المحاولة (لحدود المعدل)
        details:
          type: object
          description: سياق خطأ إضافي
      example:
        code: AUTH_REQUIRED
        message: Authentication required
        http_status: 401
  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.