{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/volanea-com/json-schema/volanea-com-inbox-message-schema.json",
  "title": "InboxMessage",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/volanea-com-openapi.json#/components/schemas/InboxMessage",
  "type": "object",
  "properties": {
    "emailId": {
      "type": "string"
    },
    "inboxId": {
      "type": "string"
    },
    "threadId": {
      "type": "string"
    },
    "direction": {
      "type": "string",
      "enum": [
        "inbound",
        "outbound"
      ]
    },
    "from": {
      "type": "string"
    },
    "fromName": {
      "type": [
        "string",
        "null"
      ]
    },
    "to": {
      "type": "string"
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "subject": {
      "type": "string"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "Plain-text part of received mail. Null on sent mail."
    },
    "extractedText": {
      "type": [
        "string",
        "null"
      ],
      "description": "`text` without quoted history and signature — the new part of a reply."
    },
    "messageId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The RFC 5322 Message-ID the other side's mail client references: the received header, or on sent mail the id the provider gave it."
    },
    "messageIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every Message-ID this message is known by."
    },
    "inReplyTo": {
      "type": [
        "string",
        "null"
      ]
    },
    "references": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "originalRecipients": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Received only: who the sender wrote to before forwarding (X-Forwarded-For, Delivered-To, X-Original-To, then To and Cc)."
    },
    "bulkSignals": {
      "type": [
        "object",
        "null"
      ],
      "description": "Received only: the headers that mark mail as machine-sent or bulk, raw — whether to auto-answer is yours to decide (a Google Group delivers real mail with List-Id and Precedence: list). Null on mail received before this field existed.",
      "properties": {
        "autoSubmitted": {
          "type": [
            "string",
            "null"
          ],
          "description": "Auto-Submitted, lowercased; `no` means a human sent it."
        },
        "precedence": {
          "type": [
            "string",
            "null"
          ],
          "description": "Precedence, lowercased: bulk, list, junk…"
        },
        "listId": {
          "type": [
            "string",
            "null"
          ],
          "description": "List-Id, lowercased."
        },
        "listUnsubscribe": {
          "type": "boolean"
        },
        "autoReply": {
          "type": "boolean",
          "description": "X-Autoreply or X-Autorespond present."
        }
      }
    },
    "identityId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Sent only: the sending identity it went out as; null = the inbox's own address."
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Sent mail only."
    },
    "security": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "scanning",
            "clear",
            "review",
            "unavailable"
          ]
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "inReplyToEmailId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The campaign/workflow/transactional email this answers, when it answers one."
    },
    "campaignId": {
      "type": [
        "string",
        "null"
      ]
    },
    "html": {
      "type": [
        "string",
        "null"
      ],
      "description": "Only on single-message and thread reads. Received HTML is sanitized: no scripts, iframes, or event handlers."
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "System: `spam`, `virus` (attachments not downloadable), `unauthenticated` (neither SPF nor DKIM passed), `held`, `security-review`, `over_quota`. Plus any you set."
    },
    "plusTag": {
      "type": [
        "string",
        "null"
      ],
      "description": "`order42` for mail sent to `name+order42@…`."
    },
    "status": {
      "type": "string"
    },
    "attachments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "inline": {
            "type": "boolean"
          }
        }
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "sentAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "required": [
    "emailId",
    "inboxId",
    "threadId",
    "direction",
    "from",
    "to",
    "subject",
    "labels",
    "createdAt"
  ]
}