{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emailconnect/main/json-schema/emailconnect-domain-schema.json",
  "title": "Domain",
  "x-generated": "2026-10-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emailconnect-openapi.json#/components/schemas/Domain",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "readOnly": true
    },
    "domain": {
      "type": "string"
    },
    "webhook": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "verified": {
          "type": "boolean"
        }
      }
    },
    "webhookUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "webhookName": {
      "type": [
        "string",
        "null"
      ]
    },
    "active": {
      "type": "boolean"
    },
    "isVerified": {
      "type": "boolean",
      "readOnly": true
    },
    "verificationStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "VERIFIED",
        "ACTIVE",
        "WARNING",
        "SUSPENDED",
        "FAILED"
      ],
      "readOnly": true
    },
    "configuration": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "allowAttachments": {
          "type": "boolean"
        },
        "includeEnvelope": {
          "type": "boolean"
        }
      }
    },
    "postfix_configured": {
      "type": "boolean",
      "readOnly": true
    },
    "mxStatus": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "POINTS_HERE",
        "ELSEWHERE",
        "NONE",
        "UNKNOWN"
      ],
      "readOnly": true,
      "description": "Whether the domain's MX points at our mail server, from the last verification check. Advisory: it does not affect `isVerified`. ELSEWHERE: the most preferred MX names another host. NONE: no MX record. UNKNOWN: the lookup failed. Null: not checked yet."
    },
    "mxHosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "readOnly": true,
      "description": "The MX hosts found at the last check, lowercased."
    },
    "expectedMxHosts": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "readOnly": true,
      "description": "The host(s) the domain's MX record should name."
    },
    "lastVerificationAttempt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    },
    "nextVerificationCheck": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    },
    "verificationFailureCount": {
      "type": "integer",
      "readOnly": true
    },
    "expectedTxtRecord": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    },
    "aliases": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "webhookName": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          }
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "id",
    "domain",
    "active",
    "isVerified"
  ]
}