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

# Respond to an approval request

> Resolve a pending approval item. The accepted request body depends on the item's `category`: `enduser` items take `{ decision: "approved" | "rejected", responded_by }`; all other categories take `{ action: "dismiss" | "create_rule", responded_by, linked_rule_id? }` (`linked_rule_id` is required when `action` is `create_rule`). Requires permission `allow_hitl:respond`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /allow/hitl/queue/{id}
openapi: 3.1.0
info:
  title: VisIQ Governance API
  version: 1.0.0
  description: >
    The VisIQ platform API for governing agentic AI. One rule engine evaluates
    every governed agent event against your policies and returns a decision
    (permit, deny, approval-required, redact, mask, or escalate), records a
    cryptographically-verifiable audit trail, and governs agent-to-agent
    delegation.


    All requests are authenticated with a bearer API key. Mint a key in the
    dashboard under **Connectors -> API Keys**; it is presented as
    `Authorization: Bearer vq_prod_...`. Keys are scoped: harness/agent keys
    reach the operational surface (evaluate, rule bundles, telemetry, record
    ingestion), while management keys and dashboard sessions govern rules,
    agents, settings, and audit reads through role-based permissions.


    Decision vocabularies differ per facet. Action governance emits `permit |
    deny | approval_required | mask`. Retrieval governance emits `allow | deny |
    redact | escalate`. The unified `POST /evaluate` surface projects both into
    a single union vocabulary (`permit | deny | approval_required | redact |
    escalate | mask`).
  contact:
    name: VisIQ Labs
    url: https://docs.visiqlabs.com
servers:
  - url: https://api.visiqlabs.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Evaluation
    description: Per-event governance decisions for action, retrieval, and delegation.
  - name: Action Rules
    description: Manage the rules that govern agent actions (writes/tool calls).
  - name: Retrieval Rules
    description: Manage the rules that govern retrieval and context exposure.
  - name: Unified Rules
    description: Operation-native rule management across both facets in one surface.
  - name: Rule Bundles
    description: Compiled, cacheable rule bundles the SDK runtime pulls per agent.
  - name: Agents
    description: Register and manage the agents whose events you govern.
  - name: Human-in-the-loop
    description: The approval queue for events that require a human decision.
  - name: Settings
    description: Per-account governance defaults.
  - name: Delegation
    description: Govern scoped agent-to-agent hand-offs with signed grant tokens.
  - name: Records
    description: Ingest, retrieve, finalize, and verify the tamper-evident audit trail.
  - name: Audit Log
    description: Versioned, paginated read APIs over recorded decisions and events.
  - name: Cognition
    description: >-
      Read captured Agent Cortex cognition sessions and beats (dedicated
      cognition:read scope).
paths:
  /allow/hitl/queue/{id}:
    parameters:
      - $ref: '#/components/parameters/HitlId'
    post:
      tags:
        - Human-in-the-loop
      summary: Respond to an approval request
      description: >
        Resolve a pending approval item. The accepted request body depends on
        the item's `category`: `enduser` items take `{ decision: "approved" |
        "rejected", responded_by }`; all other categories take `{ action:
        "dismiss" | "create_rule", responded_by, linked_rule_id? }`
        (`linked_rule_id` is required when `action` is `create_rule`). Requires
        permission `allow_hitl:respond`.
      operationId: respondHitlItem
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HitlRespondRequest'
            example:
              action: create_rule
              responded_by: alex@example.com
              linked_rule_id: 4b2b8c1e-6f2a-4a1e-9e2b-9d5b0a1c2d3e
      responses:
        '200':
          description: The resolution outcome.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HitlRespondResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - bearerAuth: []
components:
  parameters:
    HitlId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: The approval queue item UUID.
  schemas:
    HitlRespondRequest:
      description: >
        The request shape depends on the target item's `category`. `enduser`
        items use the approve/reject form; all other categories use the
        dismiss/create-rule form.
      oneOf:
        - $ref: '#/components/schemas/HitlRespondEnduser'
        - $ref: '#/components/schemas/HitlRespondEngineer'
    HitlRespondResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        decision_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          enum:
            - approved
            - rejected
            - dismissed
            - resolved
        responded_at:
          type: string
          format: date-time
        responded_by:
          type: string
    HitlRespondEnduser:
      type: object
      required:
        - decision
        - responded_by
      properties:
        decision:
          type: string
          enum:
            - approved
            - rejected
        responded_by:
          type: string
          minLength: 1
          maxLength: 255
    HitlRespondEngineer:
      type: object
      required:
        - action
        - responded_by
      properties:
        action:
          type: string
          enum:
            - dismiss
            - create_rule
        responded_by:
          type: string
          minLength: 1
          maxLength: 255
        linked_rule_id:
          type: string
          format: uuid
          description: Required when `action` is `create_rule`.
    Error:
      type: object
      required:
        - error
      description: >
        The standard error envelope. `details` carries the validation issue list
        on 400s; authorization failures add fields such as `detail`,
        `requiredScopes`, or `requiredPermission`.
      properties:
        error:
          type: string
        detail:
          type: string
        code:
          type: string
        details:
          type: array
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid request body
            details:
              - path:
                  - agent_id
                message: Required
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    Forbidden:
      description: The key lacks the required permission or scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: insufficient_scope
            detail: This API key is not authorized for the requested operation.
    NotFound:
      description: >-
        The requested resource does not exist (or is not visible to this
        account).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Rule not found
    Conflict:
      description: The request conflicts with current state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        A VisIQ API key presented as `Authorization: Bearer vq_prod_...`. Mint
        keys under **Connectors -> API Keys** in the dashboard.

````