DeckleDocs
Dashboard

API reference

Templates

Create and read reusable email templates, and browse the shared gallery.

Templates store a subject and design you can send by id. Send one by passing template to the send endpoint.

The template object#

json
{
  "id": "tmpl_123",
  "name": "Welcome",
  "category": "Onboarding",
  "subject": "Welcome, {{first_name}}",
  "source": "<html>…</html>",
  "format": "html",
  "is_system": false,
  "created_at": "2026-07-10T10:30:00.000Z",
  "updated_at": "2026-07-10T10:30:00.000Z"
}

is_system is true for shared gallery templates, which are read-only.

List templates#

GET/v1/templates

Query parameters

limitintegerOptional
Items per page. Default 50, max 100.
cursorstringOptional
Pagination cursor.
scopestringOptional
Pass all to include the shared system gallery alongside your templates.
categorystringOptional
Filter by category, e.g. Onboarding or Transactional.
ts
const { data } = await deckle.templates.list({ scope: "all" });

Create a template#

POST/v1/templates

Body parameters

namestringRequired
Template name.
subjectstringOptional
Subject line. Defaults to the name if omitted.
categorystringOptional
Category label. Defaults to the first valid category.
sourcestringOptional
The template body — HTML or serialized blocks.
format"html" | "blocks"Optional
How source is interpreted. Defaults to blocks.
const tmpl = await deckle.templates.create({
  name: "Welcome",
  subject: "Welcome, {{first_name}}",
  category: "Onboarding",
  source: "<h1>Welcome aboard!</h1>",
});

Retrieve a template#

GET/v1/templates/:id

Works for both your templates and read-only system gallery templates.

ts
const tmpl = await deckle.templates.get("tmpl_123");

Update a template#

PATCH/v1/templates/:id

Update name, category, subject, source, or format.

bash
curl -X PATCH https://app.getdeckle.com/api/v1/templates/tmpl_123 \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "subject": "Welcome to Acme, {{first_name}}" }'

Gallery templates are read-only

System templates (is_system: true) can’t be edited — a PATCH to one returns 404. Duplicate it into your project first from the dashboard.