{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-compose-request-schema.json",
  "title": "ComposeRequest",
  "description": "Body of `POST /v1/emails`.",
  "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/ComposeRequest",
  "type": "object",
  "required": [
    "contact_id"
  ],
  "properties": {
    "body_html": {
      "type": [
        "string",
        "null"
      ],
      "description": "Rich-text body. Required unless `template_id` is set."
    },
    "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact to write to. Their recorded address is the recipient."
    },
    "document_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Invoice document whose sealed PDF should ride along."
    },
    "subject": {
      "type": [
        "string",
        "null"
      ],
      "description": "Subject line. Required unless `template_id` is set."
    },
    "template_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "Saved template to start from. When set, `subject`/`body_html` are\nignored and the template's own copy is used."
    }
  }
}