{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lockally-com/json-schema/lockally-com-message-schema.json",
  "title": "Message",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lockally-com-openapi.yml#/components/schemas/Message",
  "type": "object",
  "required": [
    "id",
    "tenant_id",
    "message_id",
    "sender",
    "recipients",
    "status",
    "queued_at",
    "updated_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid"
    },
    "message_id": {
      "type": "string",
      "description": "RFC 5322 Message-ID header, including angle brackets."
    },
    "sender": {
      "type": "string",
      "format": "email"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "subject": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "sending",
        "delivered",
        "bounced",
        "deferred",
        "complaint"
      ]
    },
    "queued_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "bounce_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "size_bytes": {
      "type": [
        "integer",
        "null"
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The sender's own key/value from the send request. Always present; `{}` when none was set."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Grouping labels, lowercased and deduplicated. Always present; `[]` when none were set."
    }
  }
}