Topolo Docs Topolo Platform
Open workspace

Get email template

Read one email template with its subject, preheader and blocks. Without version it returns the current version; with version it returns that immutable historical version.

Outcome

Read one email template with its subject, preheader and blocks. Without version it returns the current version; with version it returns that immutable historical version.

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.get --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
  • id: templates record id in the selected workspace.
  • version: Integer template version, separate from the template id.

Request

GET /api/templates/{id}

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
idRequiredstringtemplates record id in the selected workspace. {"minLength":1,"maxLength":64}
versionOptionalintegerInteger template version, separate from the template id. {"minimum":1,"maximum":9007199254740991}

Exact input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "version": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    }
  },
  "required": [
    "id"
  ],
  "additionalProperties": false
}

Effects

  • Reads one template version without changing state.

Interpret the response

The returned identifier path is $.template.id for template. Empty lists do not discover a target.

Confirm $.template.id equals the requested id and $.template.version the requested version.

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:

{
  "id": "tpl_bf73c1a4be854bcaa0f9e626514a2e18"
}

CLI:

topolo actions validate app_topolo_nurture.templates.get --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.get --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.get --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.get",
    "input": {
      "id": "tpl_bf73c1a4be854bcaa0f9e626514a2e18"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "template": {
    "id": "tpl_bf73c1a4be854bcaa0f9e626514a2e18",
    "name": "Welcome aboard",
    "status": "active",
    "version": 1,
    "currentVersion": 1,
    "subject": "Welcome aboard",
    "preheader": "Start here",
    "blocks": [
      {
        "id": "h",
        "kind": "heading",
        "level": 1,
        "text": "Hello"
      },
      {
        "id": "body",
        "kind": "text",
        "text": "Your workspace is ready, {{contact.firstName|there}}."
      },
      {
        "id": "footer",
        "kind": "footer"
      }
    ],
    "createdAt": "2026-10-04T00:32:34.573Z",
    "updatedAt": "2026-10-04T00:32:34.573Z"
  }
}

HTTP 200. Confirm $.template.id equals the requested id and $.template.version the requested version.

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:

{
  "id": "tpl_8583cb2c15bd47f0b2d05e265518548d"
}

CLI:

topolo actions validate app_topolo_nurture.templates.get --data @payload.json --json
topolo actions plan app_topolo_nurture.templates.get --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.templates.get --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.get",
    "input": {
      "id": "tpl_8583cb2c15bd47f0b2d05e265518548d"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "template": {
    "id": "tpl_8583cb2c15bd47f0b2d05e265518548d",
    "name": "Welcome v2 · email_1",
    "status": "active",
    "version": 1,
    "currentVersion": 1,
    "subject": "One",
    "blocks": [
      {
        "id": "b",
        "kind": "text",
        "text": "Glad you are here."
      },
      {
        "id": "footer",
        "kind": "footer"
      }
    ],
    "createdAt": "2026-10-04T00:32:34.767Z",
    "updatedAt": "2026-10-04T00:32:34.767Z"
  }
}

HTTP 200. Confirm $.template.id equals the requested id and $.template.version the requested version.

Refused request · not_found

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:

{
  "id": "tpl_170548a3f8c04a9191b2ce2478b113af",
  "version": 9
}

CLI:

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

Captured local response · HTTP 404:

{
  "error": {
    "code": "not_found",
    "message": "Template was not found in this workspace."
  }
}

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

Verify the result

  • Confirm $.template.id equals the requested id and $.template.version the requested version.

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 to find a valid id in this workspace.

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.

  • 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.
  • 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.

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.