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

# إلغاء موافقة الوكيل

> يمكن للمُرسل الأصلي المصادق عليه فقط إلغاء طلب معلق وغير منتهي الصلاحية. يمكن للمستخدمين البشريين ونفس مفتاح API الأصلي إلغاء طلباتهم الخاصة. يحافظ الإلغاء على السجل والمراجعات السابقة.

يمكن للمُرسل الأصلي المصادق عليه فقط إلغاء طلب معلق وغير منتهي الصلاحية. يمكن للمستخدمين البشريين ونفس مفتاح API الأصلي إلغاء طلباتهم الخاصة. يحافظ الإلغاء على السجل والمراجعات السابقة.

راجع [مراجعات الوكيل المستقل](https://docs.truthlocks.com/ar/guides/agent-approvals.md) لحدود التفويض والتنفيذ.


## OpenAPI

````yaml ar/maip-openapi.yaml POST /v1/approvals/{approvalID}/cancel
openapi: 3.0.3
info:
  title: Truthlocks MAIP receipts and approvals
  version: 2.0.0
servers:
  - url: https://api.truthlocks.com
    description: الإنتاج
  - url: https://sandbox-api.truthlocks.com
    description: بيئة اختبار (Sandbox)
security:
  - apiKey: []
  - bearerAuth: []
paths:
  /v1/approvals/{approvalID}/cancel:
    post:
      tags:
        - Agent approvals
      summary: إلغاء موافقة الوكيل
      description: >-
        يمكن للمُرسل الأصلي المصادق عليه فقط إلغاء طلب معلق وغير منتهي الصلاحية.
        يمكن للمستخدمين البشريين ونفس مفتاح API الأصلي إلغاء طلباتهم الخاصة.
        يحافظ الإلغاء على السجل والمراجعات السابقة.
      operationId: maipApprovalsCancel
      parameters:
        - name: approvalID
          in: path
          required: true
          description: معرف UUID الذي تم إرجاعه عند إنشاء طلب الموافقة.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  type: string
                  minLength: 1
                  description: سبب القرار؛ غير فارغ وبحد أقصى 2000 بايت UTF-8.
      responses:
        '200':
          description: النتيجة المسجلة
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/AgentApproval'
                  - type: object
                    properties:
                      approval_id:
                        type: string
                        format: uuid
                        description: اسم مستعار للمعرف للتوافق.
        '400':
          description: معرف غير صالح، حقول طلب، أو سبب قرار
        '401':
          description: المصادقة مطلوبة
        '403':
          description: >-
            نطاق مساحة عمل خاطئ، أو إذن مراجع حالي مفقود، أو مراجعة ذاتية، أو
            إلغاء غير مصرح به
        '404':
          description: الوكيل المطلوب أو النشط غير موجود في بيئة مساحة العمل هذه
        '409':
          description: تم اتخاذ القرار بالفعل، مراجع مكرر، أو طلب منتهي الصلاحية
components:
  schemas:
    AgentApproval:
      type: object
      required:
        - id
        - agent_id
        - status
        - requested_by
        - required_approvals
        - current_approvals
        - expires_at
        - decisions
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        agent_id:
          type: string
        action:
          type: string
        resource:
          type: string
        scope:
          type: string
        justification:
          type: string
        requested_by:
          type: string
          description: >-
            الطلب المصادق عليه: UUID للمستخدم البشري أو api_key:<stored key ID>؛
            ليس مراجعًا مقدمًا من المتصل أبدًا.
        decision_reason:
          type: string
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
            - expired
            - cancelled
        risk_level:
          type: string
          enum:
            - low
            - medium
            - high
            - critical
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        decided_at:
          type: string
          format: date-time
        decided_by:
          type: string
          description: المراجع النهائي أو الطالب يلغي الطلب؛ غائب أثناء الانتظار.
        required_approvals:
          type: integer
          minimum: 1
          maximum: 10
        current_approvals:
          type: integer
          minimum: 0
          maximum: 10
        decisions:
          type: array
          description: >-
            مراجعات فردية غير قابلة للتغيير. تترك استجابة قائمة الانتظار هذا
            فارغًا؛ احصل على الطلب لسجل المراجعة الكامل الخاص به.
          items:
            type: object
            properties:
              reviewer_id:
                type: string
                format: uuid
              decision:
                type: string
                enum:
                  - approved
                  - rejected
              reason:
                type: string
              created_at:
                type: string
                format: date-time
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
    bearerAuth:
      type: http
      scheme: bearer

````

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