{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/MessageContent",
  "title": "MessageContent",
  "type": "object",
  "description": "The full content of a sent message.",
  "properties": {
    "ts": {
      "type": "integer",
      "description": "Unix timestamp of when the message was sent.",
      "example": 10
    },
    "_id": {
      "type": "string",
      "description": "The unique message ID.",
      "example": "500123"
    },
    "from_email": {
      "type": "string",
      "format": "email",
      "description": "The sender email address.",
      "example": "user@example.com"
    },
    "from_name": {
      "type": "string",
      "description": "The sender display name.",
      "example": "example_value"
    },
    "subject": {
      "type": "string",
      "description": "The message subject line.",
      "example": "example_value"
    },
    "to": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "description": "Recipient email address."
        },
        "name": {
          "type": "string",
          "description": "Recipient display name."
        }
      },
      "description": "The primary recipient.",
      "example": "example_value"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Tags applied to the message.",
      "example": []
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The full message headers.",
      "example": "example_value"
    },
    "text": {
      "type": "string",
      "description": "The plain-text body of the message.",
      "example": "example_value"
    },
    "html": {
      "type": "string",
      "description": "The HTML body of the message.",
      "example": "example_value"
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The attachment file name."
          },
          "type": {
            "type": "string",
            "description": "The MIME type of the attachment."
          },
          "content": {
            "type": "string",
            "description": "Base64-encoded attachment content."
          }
        }
      },
      "description": "File attachments included in the message.",
      "example": []
    }
  }
}