---
title: "Get a template"
method: GET
path: "/api/templates.get"
---

# Get a template

`GET /api/templates.get`

Retrieves a single template by ID. Optionally specify a version number to retrieve a specific version.

## Query parameters

- `workspace_id` string, required
- `id` string, required
- `version` integer

## Response `200`

Template retrieved successfully

- object
  - `template` Template
    - `id` string, required — Unique identifier for the template (alphanumeric, underscores, and hyphens only)
    - `name` string, required — Name of the template
    - `version` integer — Version number of the template
    - `channel` 'email' | 'web', required — Communication channel
    - `email` EmailTemplate
      - `sender_id` string — ID of the sender configuration to use
      - `reply_to` string, email — Reply-To email address
      - `subject` string, required — Email subject line (supports Liquid templating)
      - `subject_preview` string, nullable — Preview text shown in email clients
      - `compiled_preview` string, required — Compiled HTML preview of the email
      - `visual_editor_tree` object, required — MJML visual editor tree structure
      - `text` string, nullable — Plain text version of the email
    - `web` WebTemplate
      - `content` object, required — Tiptap JSON content (source of truth for web templates)
      - `html` string — Pre-rendered HTML for display
      - `plain_text` string — Extracted text for search indexing
    - `category` 'marketing' | 'transactional' | 'welcome' | 'opt_in' | 'unsubscribe' | 'bounce' | 'blocklist' | 'blog' | 'other', required — Template category
    - `template_macro_id` string, nullable — ID of the template macro (layout) to use
    - `integration_id` string, nullable — ID of the integration managing this template (e.g., Supabase)
    - `test_data` object — Test data for template preview
    - `settings` object — Channel-specific third-party settings
    - `created_at` string, date-time — When the template was created
    - `updated_at` string, date-time — When the template was last updated
    - `deleted_at` string, date-time, nullable — When the template was deleted (null if active)

## Other responses

- `400` — Bad request - validation failed
- `401` — Unauthorized - invalid or missing authentication token
- `404` — Template not found
- `500` — Internal server error

## Changes

- **2025-12-01** `bca4a43d9d46` — 1 info
  - added the optional property `template/email/text` to the response with the `200` status
- **2025-11-14** `940c5636d0b4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pierre-b/apis/notifuse-api/changes/api/templates.get/get.md)

---

[API](https://skmtc.dev/pierre-b/apis/notifuse-api.md) · [All operations](https://skmtc.dev/pierre-b/apis/notifuse-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pierre-b/notifuse-api/revisions/d26605f2fc47/schema)
