{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ranla-ai/json-schema/ranla-ai-email-list-item-schema.json",
  "title": "EmailListItem",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ranla-ai-openapi.yml#/components/schemas/EmailListItem",
  "type": "object",
  "required": [
    "id",
    "from",
    "to",
    "subject",
    "status",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "reply_to": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "subject": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "scheduled",
        "sent",
        "delivered",
        "delayed",
        "opened",
        "clicked",
        "bounced",
        "complained",
        "failed",
        "suppressed",
        "cancelled"
      ],
      "description": "Latest delivery state. `delayed` means delivery was deferred and has not completed\nyet. `opened` and `clicked` are set when tracking records engagement; they never\nreplace `bounced`, `complained`, `failed`, or `suppressed`. `suppressed` means nothing\nwas sent because a recipient is suppressed or opted out of the email's category.\n"
    },
    "last_event": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "queued",
        "scheduled",
        "sent",
        "delivered",
        "delayed",
        "opened",
        "clicked",
        "bounced",
        "complained",
        "failed",
        "suppressed",
        "cancelled",
        "send_failed",
        "account_sending_blocked",
        "plan_limit"
      ],
      "description": "Most recent delivery event recorded for this email. `send_failed` means the mail\nserver did not accept the message, `account_sending_blocked` and `plan_limit` mean\nthe account could not send it. Unlike `status`, opens and clicks can appear here\nafter a bounce.\n"
    },
    "bounce_reason": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why delivery failed, as reported by the recipient's mail server. Set for bounces,\ncomplaints, and failed sends.\n"
    },
    "tags": {
      "oneOf": [
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmailTag"
          }
        },
        {
          "type": "object"
        }
      ],
      "nullable": true
    },
    "scheduled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancelled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "sent_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "delivered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "bounced_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "EmailTag": {
      "type": "object",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    }
  }
}