Mail API reference

Mail API · Templates

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

Get a template, layout, or partial by name.

Path parameters

workspace_id*string · uuid

Id of the workspace.

name*string

Name of the template.

Response · 200

id*string · uuid

The template id.

workspace_id*string · uuid

The workspace that owns the template.

name*string

Template name, unique in the workspace; used in send URLs.

kind*object

What the template is: a sendable `template`, a `layout` that wraps templates, or a `partial` included by them.

subject*string

Subject line (Handlebars).

body_html*string

HTML body (Handlebars).

body_text*string

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

variables_schema*object

Declared variable schema (`{ version: 1, vars: { <name>: { type, required?, default?, description?, options? } } }`), as stored; null if not configured.

tags*array

Tags for organising templates.

created_at*string · date-time

When the template was created.

updated_at*string · date-time

When the template was last changed.

source*object

Where this row came from. 'manual' for UI-authored, 'github' for rows maintained by the workspace GitHub integration sync. Migration 0020.

source_ref*string

Stable provider pointer used by the editor to build "Open on GitHub →" links. Shape: `github:<owner>/<repo>@<branch>:<path-in-repo>`.

source_synced_at*string · date-time

When the sync service last wrote this row. null for manual rows.

Example

Request

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

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "workspace_id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "kind": {},
  "subject": "string",
  "body_html": "string",
  "body_text": "string",
  "variables_schema": {},
  "tags": [
    "string"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "source": {},
  "source_ref": "string",
  "source_synced_at": "2026-01-01T00:00:00.000Z"
}