Documentation

Get Template

Retrieve a single email template by template_id (TypeID) or user_id.

A test key looking up by user_id returns the test template if one exists, otherwise the production template. A production key only returns production templates.

GET /templates/:template_id
Example: /templates/welcome

Path Parameters

template_id string required

The template TypeID or user_id.

Example

curl -X GET https://api.mailcast.io/v1/templates/:template_id \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Content-Type: application/json"
Response 200
{
  "template_id": "template_01k3tgwp77ewj9bycmam3kzasg",
  "user_id": "welcome",
  "name": "welcome",
  "mjml": "<mjml><mj-body><mj-section><mj-column><mj-text>Hello {{name}}</mj-text></mj-column></mj-section></mj-body></mjml>",
  "from": "hello@example.com",
  "to": null,
  "subject": "Welcome {{name}}",
  "test_only": false,
  "created_at": "2025-08-29T12:00:00Z",
  "updated_at": "2025-08-29T12:00:00Z"
}