{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-create-template-request-schema.json",
  "title": "CreateTemplateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-templates-api-openapi.yml#/components/schemas/CreateTemplateRequest",
  "type": "object",
  "required": [
    "name",
    "subject"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "subject": {
      "type": "string"
    },
    "format": {
      "type": "string",
      "enum": [
        "html",
        "blocks"
      ]
    },
    "preheader": {
      "type": "string"
    },
    "html": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "design": {
      "type": "object",
      "additionalProperties": true,
      "description": "Required when format is blocks (defaults to empty document). Supports `settings.globalCss` for author-supplied CSS compiled at render time."
    },
    "alias": {
      "type": "string"
    },
    "variables": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "unsubscribe_enabled": {
      "type": "boolean"
    },
    "category": {
      "type": "string",
      "enum": [
        "transactional",
        "product"
      ],
      "default": "transactional",
      "description": "`newsletter` is rejected with a `validation_error`: templates are for transactional and product email. Approved accounts send newsletters with `category: newsletter` on `POST /emails`."
    },
    "folder": {
      "type": "string",
      "maxLength": 64,
      "description": "Folder to file it in on the dashboard, matched by name (any case) and created when it does not exist."
    }
  }
}