/v1/workspaces/{workspace_id}/templates/{name}AuthGet a template, layout, or partial by name.
Path parameters
workspace_id*string · uuidId of the workspace.
name*stringName of the template.
Response · 200
id*string · uuidThe template id.
workspace_id*string · uuidThe workspace that owns the template.
name*stringTemplate name, unique in the workspace; used in send URLs.
kind*objectWhat the template is: a sendable `template`, a `layout` that wraps templates, or a `partial` included by them.
subject*stringSubject line (Handlebars).
body_html*stringHTML body (Handlebars).
body_text*stringPlain-text body (Handlebars); null to derive it from the HTML.
variables_schema*objectDeclared variable schema (`{ version: 1, vars: { <name>: { type, required?, default?, description?, options? } } }`), as stored; null if not configured.
tags*arrayTags for organising templates.
created_at*string · date-timeWhen the template was created.
updated_at*string · date-timeWhen the template was last changed.
source*objectWhere this row came from. 'manual' for UI-authored, 'github' for rows maintained by the workspace GitHub integration sync. Migration 0020.
source_ref*stringStable 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-timeWhen 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_TOKENResponse
{
"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"
}