Topolo Docs Topolo Platform
Open workspace

Validate email template

Check a saved template version or an unsaved draft for problems without saving: a missing or misplaced unsubscribe footer, duplicate block ids, unknown merge fields and unsafe inline links are errors; missing image alt text and a missing brand postal address are warnings.

Outcome

Check a saved template version or an unsaved draft for problems without saving: a missing or misplaced unsubscribe footer, duplicate block ids, unknown merge fields and unsafe inline links are errors; missing image alt text and a missing brand postal address are warnings.

Before you start

  • Verify identity and pin the intended organization and environment before discovering the action.
  • Discover a granted Nurture workspace. The application permission is workspace:read; required workspace access is read. A permission alone does not supply a workspace grant.
  • Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.

Discover the target

topolo whoami --json
topolo actions get app_topolo_nurture.templates.validate --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
topolo actions get app_topolo_nurture.templates.list --detail --json
topolo actions get app_topolo_nurture.templates.get --detail --json
  • templateId: Nurture template id; inspect its active state and version.
  • version: Integer template version, separate from the template id.

Request

POST /api/templates/validate

Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.

Inspect and test this action in the signed action console. A test response still requires the verification below.

Input fields

FieldRequiredTypeConstraints
templateIdOptionalstringNurture template id; inspect its active state and version. {"minLength":1,"maxLength":64}
versionOptionalintegerInteger template version, separate from the template id. {"minimum":1,"maximum":9007199254740991}
draftOptionalobject{}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "templateId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "draft": {
      "type": "object",
      "properties": {
        "subject": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "preheader": {
          "type": "string",
          "maxLength": 200
        },
        "blocks": {
          "minItems": 1,
          "maxItems": 100,
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "heading"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "level": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      },
                      {
                        "type": "number",
                        "const": 3
                      }
                    ]
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "text",
                  "level"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "text"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 10000
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "text"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "image"
                  },
                  "src": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^https:\\/\\/[^\\s\"'<>]+$"
                  },
                  "alt": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 16,
                    "maximum": 600
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "src",
                  "alt"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "button"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "href": {
                    "type": "string",
                    "maxLength": 2000,
                    "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                  },
                  "align": {
                    "type": "string",
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "label",
                  "href"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "divider"
                  }
                },
                "required": [
                  "id",
                  "kind"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "spacer"
                  },
                  "height": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 96
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "height"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "columns"
                  },
                  "columns": {
                    "minItems": 2,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "heading"
                              },
                              "text": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 300
                              },
                              "level": {
                                "anyOf": [
                                  {
                                    "type": "number",
                                    "const": 1
                                  },
                                  {
                                    "type": "number",
                                    "const": 2
                                  },
                                  {
                                    "type": "number",
                                    "const": 3
                                  }
                                ]
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text",
                              "level"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "text"
                              },
                              "text": {
                                "type": "string",
                                "maxLength": 10000
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "text"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "image"
                              },
                              "src": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^https:\\/\\/[^\\s\"'<>]+$"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 300
                              },
                              "width": {
                                "type": "integer",
                                "minimum": 16,
                                "maximum": 600
                              },
                              "href": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "src",
                              "alt"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "button"
                              },
                              "label": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              },
                              "href": {
                                "type": "string",
                                "maxLength": 2000,
                                "pattern": "^(https:\\/\\/|mailto:)[^\\s\"'<>]+$"
                              },
                              "align": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "center",
                                  "right"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "label",
                              "href"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "divider"
                              }
                            },
                            "required": [
                              "id",
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                              },
                              "kind": {
                                "type": "string",
                                "const": "spacer"
                              },
                              "height": {
                                "type": "integer",
                                "minimum": 4,
                                "maximum": 96
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "height"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    }
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "columns"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_-]{0,31}$"
                  },
                  "kind": {
                    "type": "string",
                    "const": "footer"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "id",
                  "kind"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "subject",
        "blocks"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

Effects

  • Validates content without changing state.

Interpret the response

This is a preview or validation result, not a newly discovered template identifier. Retain the input template id and inspect the preview or validation problems.

valid is true exactly when no problem has severity error.

Exact success schema:

{
  "type": "object",
  "required": [
    "valid",
    "problems"
  ],
  "properties": {
    "valid": {
      "type": "boolean"
    },
    "problems": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "path",
          "code",
          "message",
          "severity"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "error",
              "warning"
            ]
          }
        }
      }
    }
  }
}

Worked examples

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.

Successful request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "templateId": "tpl_db617df34c4f479e9f7ad8ed37d7350b"
}

CLI:

topolo actions validate app_topolo_nurture.templates.validate --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.validate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.validate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.templates.validate",
    "input": {
      "templateId": "tpl_db617df34c4f479e9f7ad8ed37d7350b"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "valid": true,
  "problems": [
    {
      "path": "brand.postalAddress",
      "code": "postal_address_missing",
      "message": "Marketing email must carry a postal address; set one on the Brand kit or the template brand settings.",
      "severity": "warning"
    }
  ]
}

HTTP 200. valid is true exactly when no problem has severity error.

Another supported request

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{
  "draft": {
    "subject": "s",
    "blocks": [
      {
        "id": "title",
        "kind": "heading",
        "text": "Hi {{contact.firstName|there}}",
        "level": 1
      }
    ]
  }
}

CLI:

topolo actions validate app_topolo_nurture.templates.validate --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.validate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.validate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_nurture.templates.validate",
    "input": {
      "draft": {
        "subject": "s",
        "blocks": [
          {
            "id": "title",
            "kind": "heading",
            "text": "Hi {{contact.firstName|there}}",
            "level": 1
          }
        ]
      }
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "valid": false,
  "problems": [
    {
      "path": "blocks",
      "code": "footer_required",
      "message": "A template needs exactly one unsubscribe and preference footer block.",
      "severity": "error"
    },
    {
      "path": "brand.postalAddress",
      "code": "postal_address_missing",
      "message": "Marketing email must carry a postal address; set one on the Brand kit or the template brand settings.",
      "severity": "warning"
    }
  ]
}

HTTP 200. valid is true exactly when no problem has severity error.

Refused request · template_or_draft_required

Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_nurture.templates.validate --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.validate --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 422:

{
  "error": {
    "code": "template_or_draft_required",
    "message": "Send templateId (optionally with version) or a draft."
  }
}

HTTP 422. Preserve the refusal details and do not claim success.

Verify the result

  • valid is true exactly when no problem has severity error.

Errors and recovery

  • organization_required (HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.
  • permission_denied (HTTP 403): Grant the credential the required Nurture workspace permission.
  • workspace_required (HTTP 409): Create a Nurture workspace, or pass the workspace resource context.
  • invalid_input (HTTP 422): Correct the fields named in error.details using inputSchema, then retry.
  • not_found (HTTP 404): List templates with app_topolo_nurture.templates.list; when a version is given it must exist.
  • template_or_draft_required (HTTP 422): Send templateId (optionally version) or a draft {subject, preheader?, blocks}.

Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.

Recovery boundary

This action does not change service state.

  • Create email template: Create an email template (version 1) in the caller's Nurture workspace. Nothing is sent. blocks is an ordered list of typed blocks: heading {text, level 1-3}, text {text with bold, italic and label only}, image {src https, alt, width?, href?}, button {label, href https or mailto}, divider, spacer {height}, columns {2-3 columns of the other leaf blocks}, and exactly one footer {text?} as the LAST block, which always renders the unsubscribe and preference links plus the brand footer and postal address. Raw HTML is never accepted; every value is escaped. Merge tags {{contact.firstName|fallback}}, {{contact.lastName}} and {{contact.email}} are allowed in the subject, preheader and text.
  • Update email template: Change a template. Renaming changes it in place; any subject, preheader or blocks change appends a new immutable version and makes it current, so earlier versions stay readable. blocks is an ordered list of typed blocks: heading {text, level 1-3}, text {text with bold, italic and label only}, image {src https, alt, width?, href?}, button {label, href https or mailto}, divider, spacer {height}, columns {2-3 columns of the other leaf blocks}, and exactly one footer {text?} as the LAST block, which always renders the unsubscribe and preference links plus the brand footer and postal address. Raw HTML is never accepted; every value is escaped. Merge tags {{contact.firstName|fallback}}, {{contact.lastName}} and {{contact.email}} are allowed in the subject, preheader and text.

Evidence

Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.