List templates
Store reusable email templates server-side and render them on send via merge variables.
Store reusable email templates server-side and render them on send via merge variables. Templates support versioning so you can ship safely. This endpoint returns every template in the workspace.
GET /v3/templates
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | Optional | Page number, starting at 1. Default 1. |
per_page | integer | Optional | Templates per page, 1–100. Default 25. |
category | string | Optional | Only templates in this category. |
Versioning
Every save of the subject or body increments the template's version counter. Sends always render the template's current content — use the counter to confirm which revision is live.
Responses
| Status | Description |
|---|---|
200 | OK. A page of your templates (oldest first), each with its subject, HTML/text bodies, variable schema, version and active flag. |
401 | Missing or invalid API key. |
Code examples
cURL
curl https://api.wemail.io/v3/templates \
-H "Authorization: Bearer afn_live_…"Node.js
const res = await fetch("https://api.wemail.io/v3/templates", {
headers: {
Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
},
});
const data = await res.json();Python
import os, requests
r = requests.get(
"https://api.wemail.io/v3/templates",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
)
data = r.json()