{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ometria/json-schema/ometria-transactional-email-schema.json",
  "title": "TransactionalEmail",
  "description": "Describes a Transactional Email record.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ometria-transactional-email-api-openapi.yml#/components/schemas/TransactionalEmail",
  "type": "object",
  "required": [
    "subject",
    "to",
    "from"
  ],
  "properties": {
    "subject": {
      "type": "string",
      "description": "The subject line to be used in the email."
    },
    "to": {
      "$ref": "#/$defs/TransactionalEmailAddress",
      "description": "The 'to' email address"
    },
    "from": {
      "$ref": "#/$defs/TransactionalEmailAddress",
      "description": "The 'from' email address."
    },
    "reply_to": {
      "$ref": "#/$defs/TransactionalEmailAddress"
    },
    "transactional": {
      "type": "boolean",
      "description": "Whether this email should be considered transactional or not.",
      "default": false
    },
    "stream": {
      "type": "string",
      "description": "A string that can be made up for tracking purposes.",
      "default": "default",
      "pattern": "^[\\\\w]+$\""
    },
    "profile_id": {
      "type": "string",
      "description": "Enter a profile ID to make profile information available as dynamic content for using in your email templates."
    },
    "template_id": {
      "type": "integer",
      "format": "int32",
      "description": "The ID of the HTML email template to be used."
    },
    "content": {
      "$ref": "#/$defs/TransactionalEmailContent",
      "description": "The content of the email."
    },
    "data": {
      "type": "object",
      "description": "Data passed in this object will be made available as dynamic content which you can merge into the template before sending.",
      "default": "{}"
    },
    "url_parameters": {
      "$ref": "#/$defs/UrlParameters",
      "description": "Tracking parameters for transactional emails if no parameters are defined in the platform or in an API call."
    },
    "sandbox": {
      "type": "boolean",
      "description": "To be used during testing. When set to \"True\", the email will be processed but not sent. ",
      "default": false
    }
  },
  "$defs": {
    "TransactionalEmailAddress": {
      "type": "object",
      "description": "Describes an Email Address.",
      "required": [
        "name",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The recipient's name."
        },
        "email": {
          "type": "string",
          "description": "The recipient's email."
        }
      }
    },
    "TransactionalEmailContent": {
      "type": "object",
      "description": "Describes the Email Content.",
      "properties": {
        "html": {
          "type": "string",
          "description": "The HTML version of the email."
        },
        "text": {
          "type": "string",
          "description": "The Text version of the email."
        }
      }
    },
    "UrlParameters": {
      "type": "object",
      "description": "Tracking parameters for transactional emails if no parameters are defined in the platform or in an API call.",
      "properties": {
        "utm_medium": {
          "type": "string",
          "description": "Tracking parameter medium e.g. email"
        },
        "utm_source": {
          "type": "string",
          "description": "Tracking parameter source e.g. ometria"
        },
        "utm_campaign": {
          "type": "string",
          "description": "Campaign has and title e.g. utm_campaign=om_f8xxexx8exx2_welcome_campaign"
        }
      }
    }
  }
}