---
title: "Get a template"
method: GET
path: "/v1/templates/{id}"
tags: ["Templates"]
---

# Get a template

`GET /v1/templates/{id}`

## Request

- Base URL: `https://smtpfa.st/api`
- URL: `https://smtpfa.st/api/v1/templates/{id}`
- Auth: HTTP bearer

Get one template by id or alias. The content fields are the current draft; has_unpublished_versions says whether it differs from the published version that sends use. Requires the email:read scope.

## Path parameters

- `id` string, required

## Response `200`

The template

- Template
  - `object` string
  - `id` string
  - `current_version_id` string, nullable: Id of the published version; null until the first publish.
  - `alias` string, nullable
  - `name` string
  - `status` 'draft' | 'published'
  - `published_at` string, date-time, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `from` string, nullable
  - `subject` string, nullable
  - `reply_to` string[], nullable
  - `html` string, nullable
  - `text` string, nullable
  - `variables` TemplateVariable[]
    - `id` string
    - `key` string, required: Use it in the content as {{{KEY}}}. Letters, digits and underscores. FIRST_NAME, LAST_NAME, EMAIL, UNSUBSCRIBE_URL, RESEND_UNSUBSCRIBE_URL, contact and this are reserved.
    - `type` 'string' | 'number', required
    - `fallback_value` union: Used when a send gives no value. Must match the type. Without one, every send must pass a value for this variable or it answers 422.
      - string
      - number
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `has_unpublished_versions` boolean: The draft differs from the published version. Always true before the first publish.
  - `preview_text` string, nullable: Not in Resend.
  - `markdown` string, nullable: Not in Resend.
  - `category` string, nullable: Not in Resend.

## Other responses

- `401`: Invalid or missing API key
- `403`: Forbidden - domain not verified or insufficient permissions
- `404`: Resource not found
- `429`: Rate limit exceeded - retry after the period indicated in the Retry-After header
- `500`: Internal server error

---

[API](https://skmtc.dev/smtpfa/apis/smtpfast-api.md) · [All operations](https://skmtc.dev/smtpfa/apis/smtpfast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smtpfa/apis/smtpfast-api/revisions/79dda742f53e?raw)
