{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendguard-ai/json-schema/sendguard-ai-preflight-result-schema.json",
  "title": "PreflightResult",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendguard-ai-openapi.json#/components/schemas/PreflightResult",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "decision": {
      "type": "string",
      "enum": [
        "allow",
        "delay",
        "requires_approval",
        "block"
      ]
    },
    "risk_score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "confidence": {
      "type": "number"
    },
    "delay_seconds": {
      "type": "integer"
    },
    "reasons": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReasonCode"
      }
    },
    "recommendations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "approval": {
      "type": "object",
      "properties": {
        "queue": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "suggested_email": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "billing": {
      "type": "object",
      "properties": {
        "charged": {
          "type": "boolean"
        },
        "units": {
          "type": "integer"
        },
        "reason": {
          "type": "string"
        },
        "balance_remaining": {
          "type": "integer"
        }
      }
    }
  },
  "$defs": {
    "ReasonCode": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ]
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}