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

# سجل تجزئة المستند (تجريبي)

> مدخلات خط أنابيب المستندات الحالية وقيود التنفيذ.

> [!WARNING]
>
> يحاكي التنفيذ الحالي الاستخراج والتحقق بالذكاء الاصطناعي. لا يعتبر حكمه وثقته المولدان دليلًا على صحة المستند. لا تستخدم نقطة النهاية هذه للموافقة على الهويات، أو إثبات الامتثال، أو مصادقة المستندات.

يقبل المعالج `agent_id` و `document_hash`، مع `document_type` و `file_name` و `metadata` الاختيارية. يجب أن يكون الوكيل موجودًا ونشطًا. لا يقبل **لا** بايتات المستند في `document_b64`، أو يقوم بالتعرف الضوئي على الحروف (OCR)، أو يقارن ملفًا محملًا بالتجزئة المقدمة.

ينشئ المعالج سجله بشكل متزامن. استخدم معرف المستند المعروض مع [الحصول على المستند](https://docs.truthlocks.com/ar/api-reference/machine-identity/documents/get.md). تصف تجزئات الاستخراج التي تم إنشاؤها محتوى محاكى، وليس بايتات الملف المستخرجة. تحتوي توقيعات إيصالات خط الأنابيب حاليًا على علامات نظام بدلاً من التوقيعات التشفيرية.

للتحقق من السجل المشفر، استخدم [Verify Attestation](https://docs.truthlocks.com/ar/api-reference/verify.md) مع شهادة موقّعة حقيقية والحمولة الأصلية أو تجزئة المستند. يتحقق ذلك من السلامة وحالة السجل، وليس ما إذا كانت المطالبات الواقعية للمستند صحيحة.


## OpenAPI

````yaml ar/mint-openapi.yaml POST /v1/truth/document/verify
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/truth/document/verify:
    post:
      tags:
        - Machine Identity
      summary: التحقق من حقيقة المستند
      description: >-
        سجل تجريبي لتجزئة المستند. يتم محاكاة نتائج الاستخراج والذكاء الاصطناعي
        في التنفيذ الحالي. لا تقبل نقطة النهاية هذه بايتات المستند ويجب عدم
        استخدامها كدليل على صحة المستند.
      operationId: maip.truth.document.verify
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                agent_id:
                  type: string
                  description: الوكيل الطالب
                  format: uuid
                document_hash:
                  type: string
                  description: تجزئة SHA-256 للمستند
                document_type:
                  type: string
                file_name:
                  type: string
                metadata: {}
              type: object
              required:
                - agent_id
                - document_hash
      responses:
        '200':
          description: نتيجة التحقق من المستند
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaipDocumentVerification'
        '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:
    MaipDocumentVerification:
      type: object
      properties:
        verification_id:
          type: string
          format: uuid
        document_id:
          type: string
          format: uuid
        document_hash:
          type: string
        status:
          type: string
          enum:
            - pending
            - verified
            - failed
        results:
          type: array
          items:
            type: object
            additionalProperties: true
        verifications:
          type: array
          items:
            type: object
            additionalProperties: true
        claims:
          type: array
          items:
            $ref: '#/components/schemas/MaipTruthClaim'
        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
    MaipTruthClaim:
      type: object
      properties:
        claim_id:
          type: string
          format: uuid
        agent_id:
          type: string
          format: uuid
        claim_type:
          type: string
        payload:
          type: object
          additionalProperties: true
        evidence:
          type: array
          items:
            type: object
            additionalProperties: true
        status:
          type: string
          enum:
            - pending
            - verified
            - rejected
            - expired
        receipt_id:
          type: string
          format: uuid
        attestations:
          type: array
          items:
            $ref: '#/components/schemas/MaipAttestation'
        verified_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    MaipAttestation:
      type: object
      properties:
        attestation_id:
          type: string
          format: uuid
        witness_id:
          type: string
          format: uuid
        agent_id:
          type: string
          format: uuid
        claim_hash:
          type: string
        signature:
          type: string
        status:
          type: string
          enum:
            - pending
            - accepted
            - rejected
        created_at:
          type: string
          format: date-time
  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.