Runs examples for real against your account. Test keys only; kept in this tab, never stored on our side. Get a key
ZapSMTP / Docs / Templates

Retrieve a template

GET/v1/templates/{id}

Retrieve a template by id or alias.

Requires a full-access key.

id is what template.id takes when you send; the alias works too. published is the version sends use (null until the first publish).

published.variable_schema is null for a template last published before variable schemas existed: its sends need every variable, as before, until it is published again.

Path parameters

idstringrequired
Template id (UUID) or alias

Errors

restricted_api_keyHTTP 403
not_foundHTTP 404
template not found
GET/v1/templates/{id}
curl 'https://zapsmtp.xyz/v1/templates/welcome' \
  -H "Authorization: Bearer $ZAP_API_KEY"
Set ZAP_API_KEY in your environment.
Response 200 OK
{
  "id": "019a1f23-7f80-7192-8b3c-4d5e6f7a8b9c",
  "name": "Receipt",
  "alias": "receipt",
  "subject": "Your receipt for {{order_id}}",
  "html": "<p>Hi {{name}}, thanks for order {{order_id}}.</p>",
  "text": "Hi {{name}}, thanks for order {{order_id}}.",
  "from": "Acme <billing@acme.com>",
  "variables": {
    "name": "Jane",
    "order_id": "A-1042"
  },
  "variable_schema": [
    {
      "name": "order_id",
      "type": "string",
      "required": true,
      "example": "A-1042",
      "description": "Order number shown to the customer"
    },
    {
      "name": "name",
      "type": "string",
      "required": false,
      "default": "there",
      "example": "Jane"
    }
  ],
  "design": null,
  "created_at": "2026-10-21T16:10:00Z",
  "updated_at": "2026-10-21T16:10:00Z",
  "object": "template",
  "variable_names": [
    "order_id",
    "name"
  ],
  "status": "published",
  "has_unpublished_changes": false,
  "published_at": "2026-10-21T16:12:00Z",
  "published": {
    "subject": "Your receipt for {{order_id}}",
    "html": "<p>Hi {{name}}, thanks for order {{order_id}}.</p>",
    "text": "Hi {{name}}, thanks for order {{order_id}}.",
    "from": "Acme <billing@acme.com>",
    "design": null,
    "variable_schema": [
      {
        "name": "order_id",
        "type": "string",
        "required": true,
        "example": "A-1042",
        "description": "Order number shown to the customer"
      },
      {
        "name": "name",
        "type": "string",
        "required": false,
        "default": "there",
        "example": "Jane"
      }
    ]
  }
}