# Get one mail template

The template's metadata, its variable declarations, and the stored copy for every language it has.

## `GET /api/v1/accounts/{accountId}/templates/{slug}`

### Path parameters

- `accountId` (string, required) — Account ULID identifier.
- `slug` (string, required, 1–64 chars, pattern `^[a-z0-9][a-z0-9_-]*$`) — The template's name within this account.

### Responses

**200** — The template

`application/json` → MailTemplateDetail

- `createdAt` (integer, required)
- `defaultLang` (string, required)
- `from` (string | null, required) — The From address; always set on a template this API created
- `languages` (string[], required) — The languages this template has copy for
- `name` (string, required)
- `replyTo` (string | null, required)
- `slug` (string, required)
- `updatedAt` (integer, required)
- `variables` (object, required)
- `version` (integer, required) — Bumped by every write that changes what a send would produce
- `variants` (MailTemplateVariant[], required)
  - `html` (string | null, required)
  - `lang` (string, required)
  - `subject` (string, required)
  - `text` (string, required)
  - `updatedAt` (integer, required)

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**404** — not_found

`application/json` → ErrorBody

**503** — temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

`application/json` → ErrorBody

### Example request

```bash
curl -X GET 'https://api.open.email/api/v1/accounts/{accountId}/templates/{slug}' \
  -H 'Authorization: Bearer oek_…'
```

## TypeScript SDK

[`openemail.templates.get`](/docs/sdks/typescript/templates/get)

```ts
const mailTemplateDetail = await openemail.templates.get(accountId, slug)
```
