{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-email-message-schema.json",
  "title": "EmailMessage",
  "description": "Message payload for sending an email",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_superseded/microsoft-azure-communication-services-email-api-openapi.yml#/components/schemas/EmailMessage",
  "required": [
    "senderAddress",
    "content",
    "recipients"
  ],
  "type": "object",
  "properties": {
    "headers": {
      "description": "Custom email headers to be passed.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "senderAddress": {
      "description": "Sender email address from a verified domain.",
      "type": "string"
    },
    "content": {
      "description": "Email content to be sent.",
      "$ref": "#/$defs/EmailContent"
    },
    "recipients": {
      "description": "Recipients for the email.",
      "$ref": "#/$defs/EmailRecipients"
    },
    "attachments": {
      "description": "List of attachments. Please note that we limit the total size of an email request (which includes both regular and inline attachments) to 10MB.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/EmailAttachment"
      }
    },
    "replyTo": {
      "description": "Email addresses where recipients' replies will be sent to.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/EmailAddress"
      }
    },
    "userEngagementTrackingDisabled": {
      "description": "Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.",
      "type": "boolean"
    }
  },
  "$defs": {
    "EmailAddress": {
      "description": "An object representing the email address and its display name",
      "type": "object",
      "required": [
        "address"
      ],
      "properties": {
        "address": {
          "description": "Email address.",
          "type": "string"
        },
        "displayName": {
          "description": "Email display name.",
          "type": "string"
        }
      }
    },
    "EmailAttachment": {
      "description": "Attachment to the email.",
      "type": "object",
      "required": [
        "name",
        "contentType",
        "contentInBase64"
      ],
      "properties": {
        "name": {
          "description": "Name of the attachment",
          "type": "string"
        },
        "contentType": {
          "description": "MIME type of the content being attached.",
          "type": "string"
        },
        "contentInBase64": {
          "description": "Base64 encoded contents of the attachment",
          "type": "string",
          "format": "byte"
        },
        "contentId": {
          "description": "Unique identifier (CID) to reference an inline attachment.",
          "type": "string"
        }
      }
    },
    "EmailContent": {
      "description": "Content of the email.",
      "type": "object",
      "required": [
        "subject"
      ],
      "properties": {
        "subject": {
          "description": "Subject of the email message",
          "type": "string"
        },
        "plainText": {
          "description": "Plain text version of the email message.",
          "type": "string"
        },
        "html": {
          "description": "Html version of the email message.",
          "type": "string"
        }
      }
    },
    "EmailRecipients": {
      "description": "Recipients of the email",
      "type": "object",
      "required": [
        "to"
      ],
      "properties": {
        "to": {
          "description": "Email To recipients",
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmailAddress"
          }
        },
        "cc": {
          "description": "Email CC recipients",
          "type": "array",
          "x-ms-client-name": "CC",
          "items": {
            "$ref": "#/$defs/EmailAddress"
          }
        },
        "bcc": {
          "description": "Email BCC recipients",
          "type": "array",
          "x-ms-client-name": "BCC",
          "items": {
            "$ref": "#/$defs/EmailAddress"
          }
        }
      }
    }
  }
}