{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailshake-com/json-schema/mailshake-com-readiness-check-schema.json",
  "title": "ReadinessCheck",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailshake-com-openapi.json#/components/schemas/ReadinessCheck",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "object",
    "runID",
    "campaignID",
    "engineVersion",
    "generatedAt",
    "plan",
    "lookups",
    "durationMs"
  ],
  "properties": {
    "object": {
      "type": "string",
      "const": "readiness-check"
    },
    "scope": {
      "type": "string",
      "enum": [
        "campaign",
        "account"
      ],
      "description": "What was checked (one campaign, or every connected mail account of the team)."
    },
    "runID": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The stored run, in either scope (null only when it could not be stored; the plan is still valid)."
    },
    "stored": {
      "type": "boolean",
      "description": "Whether this run was kept for support (true in both scopes; false only when the store failed)."
    },
    "campaignID": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The checked campaign; null in account scope."
    },
    "notApplicable": {
      "type": "array",
      "description": "Checks and to-dos that do not apply to this scope, with the reason (account scope: apply_week1, since week 1 limits are applied per campaign). Empty in campaign scope.",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "check",
          "reason"
        ],
        "properties": {
          "check": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "engineVersion": {
      "type": "string",
      "description": "Version of the rules that made the plan."
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "plan": {
      "type": "object",
      "additionalProperties": true,
      "description": "The plan: verdict, tiles, findings, weeks, domains, inboxes, to-dos and a disclaimer. Every volume field names its unit (perInbox or total, per day).",
      "properties": {
        "domains": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "verdict": {
                "$ref": "#/$defs/ReadinessItemVerdict"
              }
            }
          }
        },
        "inboxes": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "verdict": {
                "$ref": "#/$defs/ReadinessItemVerdict"
              }
            }
          }
        }
      }
    },
    "lookups": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "partial",
        "timedOut"
      ],
      "properties": {
        "partial": {
          "type": "boolean",
          "description": "True when a lookup could not finish; those values are \"couldn't check\", never a pass."
        },
        "timedOut": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warmup": {
          "type": "string",
          "enum": [
            "ok",
            "unknown"
          ]
        },
        "warmupFlag": {
          "type": "string",
          "enum": [
            "on",
            "off",
            "unknown"
          ]
        },
        "domains": {
          "type": "object",
          "additionalProperties": true,
          "description": "Per domain, where each DNS, age and blacklist value came from."
        }
      }
    },
    "durationMs": {
      "type": "integer"
    }
  },
  "$defs": {
    "ReadinessItemVerdict": {
      "type": "string",
      "enum": [
        "fix_first",
        "warning",
        "slower_ramp",
        "no_warmup",
        "ready",
        "left_out"
      ],
      "description": "The worst severity among the findings that name this domain or mail account (fix_first > warning > slower_ramp > no_warmup > ready; info findings do not count). left_out: a mail account not in the plan, or a domain with none of its mail accounts in the plan and no finding."
    }
  }
}