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

# صك من خلال مسار التجميع

> صك إثبات

هذا هو نوع مسار التجميع لسك الشهادات. استخدم خيار السجل المنظم أو الحمولة المشفرة الموضح في Try It واحتفظ بنفس مفتاح Idempotency-Key عند إعادة محاولة نفس الطلب. تظل حزم التحقق وأنواع السجلات قابلة للتحديد في مخطط الطلب.


## OpenAPI

````yaml ar/mint-openapi.yaml POST /v1/attestations
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/attestations:
    post:
      tags:
        - Attestations
      summary: صك إثبات
      description: >-
        يوقع سجلًا منظمًا أو حمولة مشفرة بمفتاح مصدر متاح. حدد تنسيق الإدخال
        المطابق واحتفظ بـ Idempotency-Key لإعادة المحاولات.
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              description: >-
                اختر سجل منظم لتحديد نوع السجل وإدخال المطالبات، أو حمولة مشفرة
                لتوقيع البايتات الموجودة. لا تجمع أبدًا بين تنسيقي الإدخال.
              oneOf:
                - title: Structured record
                  type: object
                  required:
                    - issuer_id
                    - kid
                    - alg
                    - schema
                    - claims
                  properties:
                    alg:
                      $ref: '#/components/schemas/SigningAlgorithm'
                      description: يجب أن يتطابق مع مفتاح توقيع جهة الإصدار المحدد.
                    attestation_id:
                      type: string
                    content_type:
                      type: string
                      description: >-
                        نوع MIME للبايتات الأصلية، مثل application/json أو
                        application/pdf أو image/png. يتطلب إدخال
                        المخطط/المطالبات المنظمة application/json.
                      example: application/json
                    document_hash:
                      type: string
                      description: >-
                        تجزئة مستند SHA-256 سداسية عشرية اختيارية. تأخذ
                        claims.document.sha256 المضمنة الأسبقية؛ وإلا يتم
                        استخدام هذا الحقل، ثم تجزئة الحمولة المفككة.
                    issuer_id:
                      type: string
                      description: معرف UUID للمصدر الذي ينشئ الشهادة
                      format: uuid
                      example: 550e8400-e29b-41d4-a716-446655440000
                    kid:
                      type: string
                      description: معرف المفتاح لمفتاح التوقيع
                      example: es256-key-1
                    pack_id:
                      type: string
                      description: >-
                        معرف UUID لحزمة التحقق من مساحة العمل الاختيارية. استخدم
                        قائمة حزم التحقق بنفس مفتاح API لتحديد حزمة نشطة موجودة؛
                        احذفها لسجل مستقل.
                      format: uuid
                    expires_at_unix:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 253402300799
                      description: >-
                        طابع زمني Unix مستقبلي اختياري بالثواني لإدخال
                        المخطط/المطالبات المهيكلة. يتم تضمينه في حمولة JSON
                        الموقعة. بالنسبة لإدخال payload_b64url، احذف حقل الطلب
                        هذا وقم بتضمين expires_at_unix في جذر حمولة JSON الدقيقة
                        بدلاً من ذلك. لا يمكن تغيير تاريخ انتهاء الصلاحية في
                        مكانه.
                    recipient_email:
                      type: string
                      description: >-
                        مستلم اختياري للإشعار غير المتزامن بعد السك. لا يؤكد رد
                        السك الناجح التسليم.
                      format: email
                    schema:
                      type: string
                      description: >-
                        نوع السجل للإدخال المنظم. قدم المطالبات واحذف
                        payload_b64url. هذا التصنيف لا يتحقق بشكل مستقل من صحة
                        المطالبات.
                      enum:
                        - verifiable-id
                        - passport
                        - drivers-license
                        - government-id
                        - self-sovereign-id
                        - employment-verification
                        - professional-role
                        - membership-card
                        - professional-certification
                        - license
                        - accreditation
                        - degree
                        - completion-cert
                        - course-credit
                        - transcript
                        - micro-credential
                        - training-completion
                        - medical-license
                        - dea-registration
                        - board-certification
                        - health-credential
                        - vaccination-record
                        - aml-kyc
                        - security-clearance
                        - sam-gov
                        - jurisdiction-approval
                        - attestation-of-will
                        - bank-verification
                        - credit-attestation
                        - income-verification
                        - skill-badge
                        - competency
                        - industry-cert
                        - product-authenticity
                        - chain-of-custody
                        - origin-verification
                        - custom
                        - attestation
                      example: verifiable-id
                    claims:
                      type: object
                      additionalProperties: true
                      description: >-
                        حقول سجل منظمة. مطلوبة مع المخطط؛ لا يمكن دمجها مع
                        payload_b64url.
                      example:
                        full_name: Example recipient
                        employee_id: QA-001
                - title: Encoded payload
                  type: object
                  required:
                    - issuer_id
                    - kid
                    - alg
                    - payload_b64url
                  properties:
                    alg:
                      $ref: '#/components/schemas/SigningAlgorithm'
                      description: يجب أن يتطابق مع مفتاح توقيع جهة الإصدار المحدد.
                    attestation_id:
                      type: string
                    content_type:
                      type: string
                      description: >-
                        نوع MIME للبايتات الأصلية، مثل application/json أو
                        application/pdf أو image/png. يتطلب إدخال
                        المخطط/المطالبات المنظمة application/json.
                      example: application/json
                    document_hash:
                      type: string
                      description: >-
                        تجزئة مستند SHA-256 سداسية عشرية اختيارية. تأخذ
                        claims.document.sha256 المضمنة الأسبقية؛ وإلا يتم
                        استخدام هذا الحقل، ثم تجزئة الحمولة المفككة.
                    issuer_id:
                      type: string
                      description: معرف UUID للمصدر الذي ينشئ الشهادة
                      format: uuid
                      example: 550e8400-e29b-41d4-a716-446655440000
                    kid:
                      type: string
                      description: معرف المفتاح لمفتاح التوقيع
                      example: es256-key-1
                    pack_id:
                      type: string
                      description: >-
                        معرف UUID لحزمة التحقق من مساحة العمل الاختيارية. استخدم
                        قائمة حزم التحقق بنفس مفتاح API لتحديد حزمة نشطة موجودة؛
                        احذفها لسجل مستقل.
                      format: uuid
                    recipient_email:
                      type: string
                      description: >-
                        مستلم اختياري للإشعار غير المتزامن بعد السك. لا يؤكد رد
                        السك الناجح التسليم.
                      format: email
                    payload_b64url:
                      type: string
                      description: >-
                        base64url غير محشو للبايتات الدقيقة المراد توقيعها.
                        استخدم هذا أو المخطط بالإضافة إلى المطالبات.
      responses:
        '201':
          description: تم سك الإشهاد
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Attestation'
        '400':
          description: طلب غير صالح
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '413':
          description: الحمولة كبيرة جداً
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: تجاوز حد المعدل أو الحصة
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - APIKey: []
components:
  schemas:
    SigningAlgorithm:
      type: string
      enum:
        - Ed25519
        - ES256
        - ES384
        - ES512
        - RS256
        - RS384
        - RS512
        - PS256
        - PS384
        - PS512
      description: خوارزمية التوقيع لتوليد المفتاح
    Attestation:
      type: object
      properties:
        id:
          type: string
          format: uuid
        issuer_id:
          type: string
          format: uuid
        kid:
          type: string
        status:
          type: string
          enum:
            - VALID
            - REVOKED
            - SUPERSEDED
        payload:
          type: object
        signature:
          type: string
        log_index:
          type: integer
        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.