/v1/workspaces/{workspace_id}/notification-types/{type_id}/templates/{channel}/{locale}/revertAuthRevert a template
Restores an earlier version as a new version (audited as `notify.template.reverted`).
Path parameters
workspace_id*string · uuidId of the workspace.
type_id*string · uuidId of the type.
channel*enum (5)Template channel.
locale*stringTemplate locale (BCP 47).
Request body
version*integerThe version to restore (from `…/versions`). The restore is saved as a new version.
Response · 200 The template after the revert.
channel*objectChannel.
locale*stringLocale (BCP 47).
Example: "pt-PT"
version*integerCurrent version.
updated_at*string · date-timeLast change.
body*objectThe channel template, field names as shown (stored and returned exactly as sent). Text fields use the Mustache subset `{{var}}`, `{{#section}}`, `{{^inverted}}` (no partials). `inbox`: `{title, body (Markdown), action_url?, avatar_url?, actions?: [{label, url? | action_key?}] (≤ 2)}`. `email`: `{mail_template_name, data_mapping?}` (the HTML lives in Mail; `data_mapping` maps Mail variables to Notify variables). `push`: `{title?, body, url?, image_url?, badge?: "unread_count" | number, sound?, thread_id?, data_only?, apns_overrides?, fcm_overrides?}`. `webpush`: `{title, body?, url?, icon?, tag?}`. URL fields must be https (http only for localhost). At most 32 KB.
variables*arrayVariables the template uses.
Example
Request
POST https://api.notify.productcraft.co/v1/workspaces/{workspace_id}/notification-types/{type_id}/templates/{channel}/{locale}/revert
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"version": 0
}import { Notify } from "@productcraft/notify";
// Reads PRODUCTCRAFT_API_KEY and PRODUCTCRAFT_WORKSPACE_ID from the environment;
// client routes take a recipient token: notify.client({ token })
const notify = new Notify();
const template = await notify.notificationTypes.templates.revert("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f", "inbox", "pt-PT", { version: 1 });notify.notificationTypes.templates.revert(typeId, channel, locale, params, options?): Notify.Template
Response
{
"channel": {},
"locale": "pt-PT",
"version": 0,
"updated_at": "2026-01-01T00:00:00.000Z",
"body": {},
"variables": [
"string"
]
}