{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-scheduled-email-view-schema.json",
  "title": "ScheduledEmailView",
  "description": "An email that has not been sent yet.\n\nScheduled sends are **not** journal rows: nothing has been rendered or\ndispatched. They are read from the business tables that hold the schedule\n(`invoice.reminder`, `signature.envelope`), so this view is a projection\nover several sources rather than one table.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-emails-api-openapi.yml#/components/schemas/ScheduledEmailView",
  "type": "object",
  "required": [
    "id",
    "source",
    "kind",
    "scheduled_at"
  ],
  "properties": {
    "contact_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Linked contact."
    },
    "document_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Linked invoice document."
    },
    "envelope_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Linked signature envelope."
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identifier of the underlying scheduled row, unique within its `source`."
    },
    "kind": {
      "type": "string",
      "description": "What will be sent (`before_due`, `overdue_7`, `quote_before_expiry`,\n`signature_reminder`, …)."
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human label of the subject matter (document number, envelope subject)."
    },
    "scheduled_at": {
      "type": "string",
      "description": "When it is due to go out, RFC 3339."
    },
    "source": {
      "type": "string",
      "description": "Which schedule this comes from (`invoice_reminder` — one row per\noccurrence; `signature_reminder` — the envelope's next occurrence).\nTogether with `id`, addresses it for cancellation."
    },
    "to_email": {
      "type": [
        "string",
        "null"
      ],
      "description": "Intended recipient, when the source knows it."
    }
  }
}