{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/axonflow/json-schema/axonflow-pending-approvals-response-schema.json",
  "title": "PendingApprovalsResponse",
  "description": "List of pending approvals across workflows for the caller's tenant.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/axonflow-map-api-openapi.yml#/components/schemas/PendingApprovalsResponse",
  "type": "object",
  "properties": {
    "pending_approvals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PendingApproval"
      }
    },
    "count": {
      "type": "integer",
      "description": "Total number of pending approvals matching the scope."
    }
  },
  "$defs": {
    "PendingApproval": {
      "type": "object",
      "description": "A workflow step awaiting human approval. Returned by both\n`/api/v1/workflows/approvals/pending` (WCP plane) and\n`/api/v1/plans/approvals/pending` (MAP plane). The `plan_id` field is\nthe one intentional asymmetry between the two planes — populated on\nMAP-plane responses, omitted on WCP-plane responses.\n",
      "properties": {
        "workflow_id": {
          "type": "string",
          "description": "WCP workflow identifier."
        },
        "workflow_name": {
          "type": "string",
          "description": "Human-readable workflow name."
        },
        "plan_id": {
          "type": "string",
          "description": "MAP plan identifier. Populated on the MAP-plane listing\n(`/api/v1/plans/approvals/pending`); omitted (omitempty) on the\nWCP-plane listing.\n"
        },
        "step_id": {
          "type": "string",
          "description": "Step awaiting approval."
        },
        "step_index": {
          "type": "integer",
          "description": "Zero-based index of the step within the workflow."
        },
        "step_name": {
          "type": "string",
          "description": "Human-readable step name."
        },
        "step_type": {
          "type": "string",
          "enum": [
            "llm_call",
            "tool_call",
            "connector_call",
            "human_task",
            "synthesis",
            "action",
            "gate"
          ],
          "description": "Type of step operation."
        },
        "decision": {
          "type": "string",
          "enum": [
            "allow",
            "block",
            "require_approval"
          ],
          "description": "Gate decision that paused the step — always `require_approval` for pending entries."
        },
        "decision_reason": {
          "type": "string",
          "description": "Why approval is required."
        },
        "policies_matched": {
          "type": "array",
          "description": "Policies that triggered the approval requirement.",
          "items": {
            "type": "object"
          }
        },
        "step_input": {
          "type": "object",
          "description": "Step input payload (may be redacted by PII rules)."
        },
        "approval_status": {
          "type": "string",
          "enum": [
            "pending",
            "approved",
            "rejected"
          ],
          "description": "Current approval state — `pending` for listed entries."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Time of the first /gate call that paused the step."
        }
      }
    }
  }
}