{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scan-mx/json-schema/scan-mx-report-schema.json",
  "title": "Report",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scan-mx-openapi.json#/components/schemas/Report",
  "type": "object",
  "properties": {
    "domain": {
      "type": "string"
    },
    "grade": {
      "type": "string",
      "enum": [
        "A+",
        "A",
        "B",
        "C",
        "D",
        "F"
      ],
      "description": "A+ requires DMARC p=reject with reporting, MTA-STS enforce, and DANE. Specific weaknesses cap the grade regardless of score."
    },
    "score": {
      "type": "integer"
    },
    "provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "email_configured": {
      "type": "boolean",
      "description": "False when the domain resolves but has no MX, SPF, DKIM, or DMARC records at all"
    },
    "smtp_status": {
      "type": "string"
    },
    "sections": {
      "type": "object"
    },
    "checks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Check"
      }
    },
    "permalink": {
      "type": "string"
    },
    "created_at": {
      "type": "integer"
    },
    "expires_at": {
      "type": "integer"
    }
  },
  "$defs": {
    "Check": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "section": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pass",
            "warn",
            "fail",
            "info"
          ]
        },
        "severity": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "rfc": {
          "type": [
            "string",
            "null"
          ]
        },
        "details": {
          "type": [
            "object",
            "null"
          ]
        }
      }
    }
  }
}