{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-list-templates-response-schema.json",
  "title": "ListTemplatesResponse",
  "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/ListTemplatesResponse",
  "type": "object",
  "required": [
    "data",
    "has_more",
    "next_cursor"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Template"
      }
    },
    "has_more": {
      "type": "boolean"
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "Template": {
      "type": "object",
      "required": [
        "id",
        "name",
        "alias",
        "status",
        "format",
        "subject",
        "html",
        "text",
        "variables",
        "published_at",
        "created_at",
        "updated_at",
        "unsubscribe_enabled",
        "category",
        "folder"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "alias": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional unique alias per account (must not start with `gm_`)"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "published"
          ]
        },
        "format": {
          "type": "string",
          "enum": [
            "html",
            "blocks"
          ],
          "description": "html is legacy raw HTML; blocks is the visual builder document"
        },
        "subject": {
          "type": "string"
        },
        "preheader": {
          "type": [
            "string",
            "null"
          ],
          "description": "Inbox preview text injected as a hidden preheader"
        },
        "html": {
          "type": [
            "string",
            "null"
          ]
        },
        "text": {
          "type": [
            "string",
            "null"
          ]
        },
        "design": {
          "description": "TemplateDocument JSON when format is blocks. `settings.globalCss` accepts author-supplied CSS; bare-tag rules (body, p, h1, h2, h3, a, img, hr) are inlined on render and everything else is emitted into a style block.",
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true
        },
        "variables": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Variable names used in subject/html/text (auto-extracted for blocks)"
        },
        "published_version_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Immutable version snapshot used for sends"
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "unsubscribe_enabled": {
          "type": "boolean",
          "description": "When true, sends using this published template inherit managed unsubscribe unless\noverridden with `unsubscribe` on `POST /emails`.\n"
        },
        "category": {
          "type": "string",
          "enum": [
            "transactional",
            "product"
          ],
          "description": "Email category for preference management and sending. `transactional` is default and\nignores category opt-outs. `product` supports category-scoped unsubscribe and is sent\nfrom a separate IP pool.\n"
        },
        "folder": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the dashboard folder it is filed in, or null."
        },
        "warnings": {
          "type": "array",
          "description": "Non-blocking deliverability hints for template HTML (e.g. SVG image URLs)",
          "items": {
            "$ref": "#/$defs/TemplateLintWarning"
          }
        }
      }
    },
    "TemplateLintWarning": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "svg_image",
            "relative_image_url",
            "data_uri_image",
            "missing_alt",
            "non_https_image",
            "empty_href",
            "raw_html_block",
            "low_contrast",
            "html_too_large"
          ]
        },
        "message": {
          "type": "string"
        },
        "detail": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}