{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://limecloud.github.io/agentpolicy/schemas/agentpolicy-approval-request.schema.json",
  "title": "Agent Policy Approval Request",
  "type": "object",
  "required": [
    "schema_version",
    "approval_id",
    "decision_id",
    "requested_action",
    "required_approver",
    "prompt",
    "choices",
    "default_action",
    "status",
    "created_at"
  ],
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "approval_id": {
      "type": "string"
    },
    "decision_id": {
      "type": "string"
    },
    "requested_action": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "refs": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": true
    },
    "required_approver": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "minLength": 1
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "refs": {
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "additionalProperties": true
    },
    "prompt": {
      "type": "string"
    },
    "choices": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "additionalProperties": true
      }
    },
    "default_action": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "approved",
        "denied",
        "modified",
        "expired",
        "escalated",
        "cancelled"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "response": {
      "type": "object",
      "additionalProperties": true
    },
    "refs": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  },
  "additionalProperties": true
}
