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

# Authorize a delegated action against its full chain (dry-run)

> The runtime authorization gate for a DELEGATED action as a dry-run. Walks the full `[root, ..., leaf]` ancestry back to the principal's root mandate — re-verifying every hop's integrity, terminal status, expiry, ancestry link, and attenuation — then evaluates the leaf's own scope. A revoked, expired, or exhausted mandate ANYWHERE in the lineage denies the action. No state change. `chain` is ordered root-first, leaf-last (the leaf is the mandate the acting agent presents).



## OpenAPI

````yaml /openapi.yaml post /api/v1/agents/agent-authorization-mandate/authorize-chain
openapi: 3.1.0
info:
  title: Devotel CPaaS API
  description: Orbit by Devotel — Communications Platform as a Service API
  version: 1.0.0
  contact:
    name: Devotel
    url: https://devotel.io
    email: support@devotel.io
  license:
    name: Proprietary
servers:
  - url: https://api.orbit.devotel.io
    description: Production
security:
  - Bearer: []
  - ApiKey: []
tags:
  - name: Messages
    description: >-
      Send and manage messages across all channels (SMS, WhatsApp, RCS, Email,
      Viber, etc.)
  - name: Fax
    description: >-
      List and track fax (MMS/T.38) transmissions on Telnyx-backed fax numbers
      (sending flows through the Messaging API)
  - name: Agents
    description: AI agent creation, configuration, and execution
  - name: Voice
    description: Voice calls, IVR, conferencing, and SIP trunking
  - name: OnCall
    description: On-call rotations and escalation policy planning for incident alerting
  - name: Webhooks
    description: Webhook endpoint management and delivery logs
  - name: Numbers
    description: Phone number search, provisioning, and configuration
  - name: Brand Identity
    description: >-
      Unified cross-channel brand trust posture (10DLC, toll-free, WhatsApp,
      RCS, branded calling, number KYC)
  - name: Contacts
    description: Contact management, segmentation, and lifecycle tracking
  - name: Campaigns
    description: Marketing campaign orchestration and analytics
  - name: Flows
    description: Automation flow builder and execution engine
  - name: Templates
    description: Message template management and approval workflows
  - name: Settings
    description: Organization, channel, and user preference settings
  - name: Verify
    description: OTP generation and verification across channels
  - name: Push
    description: Push notification delivery via FCM and APNs
  - name: Integrations
    description: Third-party service connections and OAuth management
  - name: CDP
    description: >-
      Customer Data Platform — activation surface (CRM object sync, streaming
      destinations, ad-audience activation)
  - name: Files
    description: >-
      Server-to-server media upload, listing, retrieval, and deletion
      (signed-URL backed)
  - name: Commerce
    description: >-
      Omnichannel conversational-commerce — persistent cart + checkout state
      machine, channel-agnostic hosted pay-by-link, native WhatsApp checkout,
      and AP2-style agent payment mandates.
  - name: Sync
    description: >-
      Real-time shared-state primitive (Twilio Sync parity) — Documents, Maps,
      Lists, and ephemeral Streams, with change events relayed over the
      /api/v1/ws/sync WebSocket gateway
  - name: Risk
    description: >-
      Unified cross-channel Trust & Fraud risk scoring — fuses SMS-pumping,
      URL-reputation, Verify Fraud Guard, and Voice Biometrics signals into one
      composite verdict queryable before a send or a call.
  - name: Orby
    description: >-
      In-dashboard Orby operator assistant: streamed assistant turns,
      conversation threads, product knowledge-base search, and the tool-action
      approval gate. Available to signed-in operators only (dashboard session
      auth — API-key requests are rejected).
paths:
  /api/v1/agents/agent-authorization-mandate/authorize-chain:
    post:
      tags:
        - Agents
      summary: Authorize a delegated action against its full chain (dry-run)
      description: >-
        The runtime authorization gate for a DELEGATED action as a dry-run.
        Walks the full `[root, ..., leaf]` ancestry back to the principal's root
        mandate — re-verifying every hop's integrity, terminal status, expiry,
        ancestry link, and attenuation — then evaluates the leaf's own scope. A
        revoked, expired, or exhausted mandate ANYWHERE in the lineage denies
        the action. No state change. `chain` is ordered root-first, leaf-last
        (the leaf is the mandate the acting agent presents).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - chain
                - action
              properties:
                chain:
                  type: array
                  minItems: 1
                  maxItems: 32
                  description: The full delegation chain, ordered `[root, ..., leaf]`.
                  items:
                    $ref: '#/components/schemas/AgentAuthorizationMandate'
                action:
                  $ref: '#/components/schemas/AgentMandateAction'
      responses:
        '200':
          description: The authorization decision for the delegated action (dry-run).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      authorization:
                        $ref: '#/components/schemas/AgentMandateAuthorizationDecision'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '422':
          description: >-
            Request validation failed (malformed chain or action). `error.code`
            is `VALIDATION_ERROR`. A well-formed chain whose ancestry does not
            hold still returns 200 with `authorized: false` and an `ancestor_*`
            / `broken_ancestry_link` / `scope_not_attenuated` reason.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    AgentAuthorizationMandate:
      type: object
      description: >-
        A scoped, revocable, action-capped authorization an AI agent acts under
        — a serializable snapshot the caller stores and round-trips in each
        request body. The scope fields (principal, agent, allowlists, invocation
        cap, expiry, ancestry) are immutable after issue and bound by
        `consentDigest`; only `status`, `invocationCount`, `updatedAt`, and
        `revokedAt` advance over the mandate's life. A delegated (child) mandate
        additionally carries a `parentMandateId` + `parentDigest` pointer to the
        parent it was attenuated from.
      required:
        - id
        - agentId
        - principalId
        - allowedActions
        - allowedTools
        - allowedDataCategories
        - maxInvocations
        - invocationCount
        - status
        - consentDigest
        - expiresAt
        - createdAt
        - updatedAt
        - revokedAt
        - parentMandateId
        - parentDigest
      properties:
        id:
          type: string
          description: Opaque, caller-supplied mandate id (stable across actions).
        agentId:
          type: string
          description: >-
            The agent authorized to act — an Orbit agent id or an external
            A2A/MCP identity.
        principalId:
          type: string
          description: >-
            The principal (account holder / contact / end-user) who granted
            consent.
        allowedActions:
          type: array
          items:
            type: string
          description: >-
            Action allowlist — the verbs the agent may perform (e.g.
            `profile:read`, `booking:create`). An empty array means any action
            is in scope. Stored trimmed, sorted, and de-duped.
        allowedTools:
          type: array
          items:
            type: string
          description: >-
            Tool allowlist — the specific tool ids the agent may invoke. An
            empty array means any tool is in scope.
        allowedDataCategories:
          type: array
          items:
            type: string
          description: >-
            Data-category allowlist — the categories of data the agent may
            access (e.g. `contact_profile`, `order_history`). An empty array
            means any category is in scope.
        maxInvocations:
          type: integer
          description: >-
            Cumulative ceiling on the number of actions authorized under this
            mandate (a positive integer). The non-payment analog of a spend cap.
        invocationCount:
          type: integer
          description: Number of actions authorized so far (starts at 0).
        status:
          type: string
          enum:
            - active
            - exhausted
            - revoked
            - expired
          description: >-
            Current lifecycle status. `exhausted`, `revoked`, and `expired` are
            terminal — no further action is authorized once a mandate leaves
            `active`.
        consentDigest:
          type: string
          description: >-
            SHA-256 hex commitment over the immutable scope — the cryptographic
            consent record. Recompute and compare via the `/verify` endpoint.
        expiresAt:
          type:
            - 'null'
            - integer
          description: Epoch-ms after which the mandate is dead, or null for no expiry.
        createdAt:
          type: integer
          description: Epoch-ms the mandate was issued.
        updatedAt:
          type: integer
          description: Epoch-ms of the last status/count change.
        revokedAt:
          type:
            - 'null'
            - integer
          description: Epoch-ms the mandate was revoked, or null while still issuable.
        parentMandateId:
          type:
            - 'null'
            - string
          description: >-
            Id of the mandate this one was delegated from, or null for a root
            mandate the principal issued directly. Part of the immutable scope.
        parentDigest:
          type:
            - 'null'
            - string
          description: >-
            The parent mandate's `consentDigest` at the moment this child was
            minted — the cryptographic ancestry pointer. Null for a root
            mandate.
    AgentMandateAction:
      type: object
      description: >-
        An action an agent wants to perform under a mandate, evaluated against
        its allowlists.
      required:
        - action
        - reference
      properties:
        action:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            The action verb being attempted (checked against the action
            allowlist).
        tool:
          type:
            - 'null'
            - string
          maxLength: 256
          description: >-
            The tool id the action invokes, if any (checked against the tool
            allowlist). Omit for non-tool actions.
        dataCategory:
          type:
            - 'null'
            - string
          maxLength: 256
          description: >-
            The data category the action touches, if any (checked against the
            data-category allowlist). Omit when no scoped data is accessed.
        reference:
          type: string
          minLength: 1
          maxLength: 256
          description: >-
            Caller-supplied reference for the action — the A2A task id / MCP
            call id / tool-invocation id this authorization covers. Surfaced on
            the audit trail.
    AgentMandateAuthorizationDecision:
      type: object
      description: >-
        The decision of evaluating an action against a mandate (or a full
        delegation chain).
      required:
        - authorized
        - reason
        - mandateId
        - authorizationId
        - action
        - reference
        - remainingInvocations
      properties:
        authorized:
          type: boolean
          description: True only when `reason` is `ok`.
        reason:
          type: string
          enum:
            - ok
            - revoked
            - expired
            - exhausted
            - integrity_failed
            - invalid_action
            - action_not_allowed
            - tool_not_allowed
            - data_category_not_allowed
            - exceeds_invocation_cap
            - empty_chain
            - broken_ancestry_link
            - scope_not_attenuated
            - ancestor_revoked
            - ancestor_expired
            - ancestor_exhausted
          description: >-
            Why the action was (or was not) authorized. `ok` is the only
            authorizing reason; the `ancestor_*`, `broken_ancestry_link`,
            `scope_not_attenuated`, and `empty_chain` reasons apply only to the
            chain endpoints.
        mandateId:
          type: string
          description: The (leaf) mandate the decision was made against.
        authorizationId:
          type: string
          description: >-
            Deterministic id for this authorization attempt
            (`{mandateId}-authz-{invocationCount + 1}`). Stable across a dry-run
            and its committing call.
        action:
          type: string
          description: The action verb evaluated, echoed back for the audit trail.
        reference:
          type: string
          description: The action reference echoed back for the audit trail.
        remainingInvocations:
          type: integer
          description: >-
            Remaining authorizations under the cap after this action when
            authorized, or before it when denied. Never negative.
    ResponseMeta:
      type: object
      required:
        - request_id
        - timestamp
      additionalProperties: false
      properties:
        request_id:
          type: string
          description: Unique request identifier (also returned as X-Request-Id header)
        timestamp:
          type: string
          format: date-time
        docs_url:
          type: string
          format: uri
          nullable: true
    ErrorEnvelope:
      type: object
      required:
        - error
        - meta
      additionalProperties: false
      properties:
        error:
          type: object
          required:
            - code
            - message
            - status
          additionalProperties: false
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              nullable: true
              additionalProperties: true
        meta:
          type: object
          required:
            - request_id
            - timestamp
          additionalProperties: false
          properties:
            request_id:
              type: string
              description: Unique request identifier (also returned as X-Request-Id header)
            timestamp:
              type: string
              format: date-time
            docs_url:
              type: string
              format: uri
              nullable: true
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard JWT token from Clerk
    ApiKey:
      type: apiKey
      name: X-API-Key
      in: header
      description: Server-to-server API key (dv_live_sk_*)

````