Outcome
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.
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:write; required workspace access is read_write. 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.
- Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.
Discover the target
topolo whoami --json
topolo actions get app_topolo_nurture.templates.create --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
Request
POST /api/templates
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
| Field | Required | Type | Constraints |
|---|---|---|---|
name | Required | string | {"minLength":1,"maxLength":120} |
subject | Required | string | {"minLength":1,"maxLength":200} |
preheader | Optional | string | {"maxLength":200} |
blocks | Required | array | {"minItems":1,"maxItems":100} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"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": [
"name",
"subject",
"blocks"
],
"additionalProperties": false
}
Effects
- Creates one active template with version 1; nothing is sent.
Interpret the response
The returned identifier path is $.template.id for template. Empty lists do not discover a target.
Call app_topolo_nurture.templates.get with $.template.id and confirm the stored blocks.
Exact success schema:
{
"type": "object",
"required": [
"template"
],
"properties": {
"template": {
"type": "object",
"required": [
"id",
"subject",
"blocks",
"version",
"currentVersion"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"subject": {
"type": "string"
},
"preheader": {
"type": "string"
},
"blocks": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"kind"
]
}
},
"status": {
"type": "string",
"enum": [
"active",
"archived"
]
},
"version": {
"type": "integer"
},
"currentVersion": {
"type": "integer"
},
"createdAt": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
}
}
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:
{
"name": "News",
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
]
}
CLI:
topolo actions validate app_topolo_nurture.templates.create --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_nurture.templates.create",
"input": {
"name": "News",
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
]
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"template": {
"id": "tpl_737889e80e504b6ba06b1d3e0b50aab2",
"name": "News",
"status": "active",
"version": 1,
"currentVersion": 1,
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
],
"createdAt": "2026-10-04T00:32:37.862Z",
"updatedAt": "2026-10-04T00:32:37.862Z"
}
}
HTTP 201. Call app_topolo_nurture.templates.get with $.template.id and confirm the stored blocks.
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:
{
"name": "News",
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
]
}
CLI:
topolo actions validate app_topolo_nurture.templates.create --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_nurture.templates.create",
"input": {
"name": "News",
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
]
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 201:
{
"template": {
"id": "tpl_2c06e29663b541c583474825055b03f7",
"name": "News",
"status": "active",
"version": 1,
"currentVersion": 1,
"subject": "Hello {{contact.firstName|there}}",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hello {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
],
"createdAt": "2026-10-04T00:32:37.632Z",
"updatedAt": "2026-10-04T00:32:37.632Z"
}
}
HTTP 201. Call app_topolo_nurture.templates.get with $.template.id and confirm the stored blocks.
Refused request · permission_denied
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:
{
"name": "Welcome",
"subject": "Welcome {{contact.firstName|friend}}",
"preheader": "Start here",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hi {{contact.firstName|there}}",
"level": 1
},
{
"id": "footer",
"kind": "footer"
}
]
}
CLI:
topolo actions validate app_topolo_nurture.templates.create --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 403:
{
"error": {
"code": "permission_denied",
"message": "The credential lacks workspace:write."
}
}
HTTP 403. Preserve the refusal details and do not claim success.
Refused request · invalid_input
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:
{
"name": "Welcome",
"subject": "Welcome {{contact.firstName|friend}}",
"preheader": "Start here",
"blocks": [
{
"id": "i",
"kind": "image",
"src": "javascript:alert(1)",
"alt": ""
},
{
"id": "footer",
"kind": "footer"
}
]
}
CLI:
topolo actions validate app_topolo_nurture.templates.create --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "invalid_input",
"message": "The input does not match the action schema.",
"details": [
{
"origin": "string",
"code": "invalid_format",
"format": "regex",
"pattern": "/^https:\\/\\/[^\\s\"'<>]+$/",
"path": [
"blocks",
0,
"src"
],
"message": "Invalid string: must match pattern /^https:\\/\\/[^\\s\"'<>]+$/"
}
]
}
}
HTTP 422. Preserve the refusal details and do not claim success.
Refused request · invalid_template
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:
{
"name": "Welcome",
"subject": "Welcome {{contact.firstName|friend}}",
"preheader": "Start here",
"blocks": [
{
"id": "title",
"kind": "heading",
"text": "Hi {{contact.firstName|there}}",
"level": 1
}
]
}
CLI:
topolo actions validate app_topolo_nurture.templates.create --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.create --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "invalid_template",
"message": "The template has problems that must be fixed first.",
"details": {
"problems": [
{
"path": "blocks",
"code": "footer_required",
"message": "A template needs exactly one unsubscribe and preference footer block.",
"severity": "error"
}
]
}
}
}
HTTP 422. Preserve the refusal details and do not claim success.
Verify the result
- Call app_topolo_nurture.templates.get with $.template.id and confirm the stored blocks.
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.invalid_template(HTTP 422): Fix each problem in error.details.problems; app_topolo_nurture.templates.validate lists them without saving.
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
Archive the template created in error.
Related actions
- Preview email template: Render a saved template version (templateId, version?) or an unsaved draft to email-safe HTML (tables, inline styles, dark-mode and mobile rules) plus the auto-generated plain-text alternative, for an optional sample contact. Brand name, email logo, light and dark accent colours, footer, legal entity, postal address and unsubscribe wording come from the workspace TopoloBrand kit when one is bound and readable, else the workspace template brand settings, else neutral defaults; Brand being unavailable never fails a preview. Unsubscribe and preference links are inert placeholders (#unsubscribe, #preferences); a real send substitutes signed recipient links. No side effects: nothing is saved or sent.
- 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.
- Archive email template: Archive an email template so it can no longer be edited or chosen for new email. Its versions are kept for history.
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.