Templates
Retrieve template
Verified
GET /api/v1/templates/{id|alias}
Gets a template by id or alias.
Path Parameters
Notes
Live 2026-11-02 (API key, read). Same object as a list item. Works with the id OR the alias (welcome-email-v1). Starter templates can be read by id. Unknown id -> 404 NotFound 'Template not found.' (envelope).
Errors Status Case Body
404 error {"error": {"code": "NotFound", "message": "Template not found."}}
Snippets use the MailCraftApi (C#) and MailCraft (Python) helpers from Introduction → Helpers .
using System.Text.Json.Nodes;
using var mc = new MailCraftApi(Environment.GetEnvironmentVariable("MAILCRAFT_API_KEY")!);
JsonNode? result = await mc.SendAsync(HttpMethod.Get, "/templates/<id-or-alias>");
Console.WriteLine(result?.ToJsonString(MailCraftApi.Pretty) ?? "(no content)");import os
from mailcraft import MailCraft
mc = MailCraft(os.environ["MAILCRAFT_API_KEY"])
result = mc.request("GET", "/templates/<id-or-alias>")
print(result)curl -X GET "https://mailcraft.example.com/api/v1/templates/<id-or-alias>" \
-H "Authorization: Bearer $MAILCRAFT_API_KEY"
Response · 200 · success Copy
{
"id": "680abd8f-aaad-4b3f-aec7-efe5460921e2",
"name": "Welcome Email",
"category": "Transactional",
"content": "{}",
"htmlContent": "<html><body>Hi Jane, welcome!</body></html>",
"isStarterTemplate": false,
"isOwnedByCurrentOrganization": true,
"alias": "welcome-email-v1",
"from": "Acme <[email protected] >",
"subject": "Welcome to Acme!",
"replyTo": "[email protected] ",
"text": null,
"isPublished": false,
"status": "draft",
"variables": [
{
"key": "FIRST_NAME",
"type": 0,
"fallbackValue": "there"
}
],
"createdAt": "2026-10-07T05:20:45.483246Z",
"updatedAt": "2026-10-07T05:20:45.483246Z"
}
Response · 200 · successStarter Copy
{
"id": "00000000-0000-0000-0002-000000000001",
"name": "Flash Sale",
"category": "Promotional",
"content": "{\"styles\": [], \"components\": []}",
"htmlContent": "",
"isStarterTemplate": true,
"isOwnedByCurrentOrganization": false,
"alias": null,
"from": null,
"subject": null,
"replyTo": null,
"text": null,
"isPublished": false,
"status": "draft",
"variables": [],
"createdAt": "2026-07-18T00:00:00Z",
"updatedAt": "2026-08-09T00:00:00Z"
}