---
title: "Get Template"
method: GET
path: "/templates/{slug}"
tags: ["Templates"]
---

# Get Template

`GET /templates/{slug}`

## Request

- Base URL: `https://app.lettr.com/api`
- URL: `https://app.lettr.com/api/templates/{slug}`
- Auth: HTTP bearer

Retrieve a single email template by its slug. If `project_id` is not provided, the template will be looked up in the team's default project.

## Path parameters

- `slug` string, required

## Query parameters

- `project_id` integer

## Response `200`

Template retrieved successfully

- ShowTemplateResponse: Response containing a single template with details
  - `message` string, required: Human-readable response message
  - `data` TemplateDetailView, required: Detailed view of an email template
    - `id` integer, required: Unique identifier for the template
    - `name` string, required: Name of the template
    - `slug` string, required: URL-friendly identifier for the template
    - `project_id` integer, required: ID of the project containing this template
    - `folder_id` integer, required: ID of the folder containing this template
    - `purpose` 'transactional' | 'campaign', required: Module the template belongs to. `transactional` templates are the ones you send single emails with; `campaign` templates are the ones the campaign builder can pick.
    - `preparation_status` 'pending' | 'ready' | 'failed', required: How far the template has got through preparation. Creating or updating a template through the API defers image migration and HTML rendering to a background job, so the template is `pending` until that finishes. On a create with JSON there is no HTML at all yet - the editor works (it reads the JSON) but sending and the screenshot do not. On an update the previous render stays in place, so the template remains sendable, but it is still serving the *old* content until this reads `ready`. `failed` means preparation exhausted its retries and will not become ready on its own. A template created from raw HTML is `ready` immediately.
    - `active_version` integer, nullable, required: Version number of the currently active template version, or null if no version is active
    - `versions_count` integer, required: Total number of versions for this template
    - `html` string, nullable: The HTML content of the active template version, or null if no active version exists
    - `json` string, nullable: The JSON definition of the active template version (for visual editor templates), or null if no active version exists or it's a custom HTML template
    - `created_at` string, date-time, required: When the template was created
    - `updated_at` string, date-time, required: When the template was last updated

## Other responses

- `401`: Unauthorized - Missing or invalid API key
- `404`: Template or project not found
- `422`: Validation error
- `500`: Server error
- `503`: Service unavailable - the API key could not be verified, so the request was not processed. This does not mean the key is invalid; retry after the delay given in the Retry-After header.

---

[API](https://skmtc.dev/lettr/apis/lettr-api.md) · [All operations](https://skmtc.dev/lettr/apis/lettr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/lettr/apis/lettr-api/revisions/48ef0dac1ebd?raw)
