{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailfornet-com/json-schema/mailfornet-com-message-schema.json",
  "title": "Message",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mailfornet-com-openapi.json#/components/schemas/Message",
  "allOf": [
    {
      "$ref": "#/$defs/MessageSummary"
    },
    {
      "type": "object",
      "properties": {
        "to": {
          "type": "string",
          "format": "email"
        },
        "text": {
          "type": "string"
        },
        "html": {
          "type": "string"
        },
        "attachments": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The verification code or OTP found in the message, if any."
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Link"
          },
          "description": "Every http(s) link, HTML anchors first. At most 50."
        },
        "verificationLink": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The link that most likely confirms, verifies or signs in. Unsubscribe and social links are never chosen."
        }
      }
    }
  ],
  "$defs": {
    "Link": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "text": {
          "type": "string",
          "description": "The anchor text, empty for a bare URL in the plain-text part."
        }
      }
    },
    "MessageSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "intro": {
          "type": "string",
          "description": "The first line, for matching without a second call."
        },
        "date": {
          "type": "string",
          "format": "date-time",
          "description": "When the message arrived."
        }
      }
    }
  }
}