Mail API reference

Mail API · Templates

get/v1/workspaces/{workspace_id}/templates/{name}/versions/{version}Auth

Get one published version of a template.

Path parameters

workspace_id*string · uuid

Id of the workspace.

name*string

Name of the template.

version*integer

The version number (1 for the first published version).

Response · 200

author_type*object

`user` (a person in the console), `api_key`, `agent` (an MCP or OAuth client acting for a person), `github` (a synced commit) or `system` (versions created by Mail, such as version 1 of a template that existed before history).

author_id*string · uuid

Account id or API key id of the author; null for `github` and `system`.

author_label*string

Display name: email, key name or client name; the repository for `github`.

id*string · uuid

The version row id.

template_id*string · uuid

The template this version belongs to.

version*number

Version number, 1 for the first published version.

subject*string

Subject line (Handlebars).

body_html*string

HTML body (Handlebars).

body_text*string

Plain-text body; null to derive it from the HTML.

variables_schema*object

Variable schema of this version; null if none.

note*string

Publish note; for a GitHub version, the first line of the commit message.

source*object

`manual` (console or API), `github` (a synced commit; `source_ref` is its SHA) or `migration` (the content a template had when version history started).

source_ref*string

Commit SHA for a `github` version; else null.

restored_from*number

The version this one restored, if it was published from a restore.

created_at*string · date-time

When it was published.

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/templates/{name}/versions/{version}
Authorization: Bearer YOUR_TOKEN

Response

{
  "author_type": {},
  "author_id": "00000000-0000-0000-0000-000000000000",
  "author_label": "string",
  "id": "00000000-0000-0000-0000-000000000000",
  "template_id": "00000000-0000-0000-0000-000000000000",
  "version": 0,
  "subject": "string",
  "body_html": "string",
  "body_text": "string",
  "variables_schema": {},
  "note": "string",
  "source": {},
  "source_ref": "string",
  "restored_from": 0,
  "created_at": "2026-01-01T00:00:00.000Z"
}