API referenceTemplates
Restore a template version
Saves a copy of an older version as the latest: the one in use.
POST
Saves a copy of an older version as the latest: the one in use.
apiKey writeheader
AuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
id*stringFormat
uuididempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
Length
1 <= length <= 255application/json- body
versionId*stringFormat
uuidOK
application/json- response
id*stringFormat
uuidkind*stringname*stringfolder*|The folder it’s in; null at the top level
status*stringValue in
"active""archived"versionId*stringFormat
uuidcreatedAt*stringFormat
date-timeupdatedAt*stringFormat
date-timearchivedAt*|Format
date-timelocales*array<string>thumbnailUrl*|Format
uriversion*curl -X POST 'https://api.postforge.dev/v1/templates/497f6eca-6276-4993-bfeb-53cbbbba6f08/restore' \ -H 'Content-Type: application/json' \ -d '{ "versionId": "14707576-2549-4848-82ed-f68f8a1b47c7"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "string", "name": "string", "folder": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "status": "active", "versionId": "14707576-2549-4848-82ed-f68f8a1b47c7", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archivedAt": "2019-08-24T14:15:22Z", "locales": [ "string" ], "thumbnailUrl": "http://example.com", "version": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "definitionId": "058563fe-6949-46e9-9fb3-06a0e3a11f6a", "parentVersionId": "abf80970-9686-419e-bc00-5ddcccc33ba6", "origin": "edit", "schemaVersion": 0, "author": { "type": "user", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string" }, "createdAt": "2019-08-24T14:15:22Z", "openedAt": "2019-08-24T14:15:22Z", "definition": { "locales": [ "string" ], "settings": { "width": 320, "background": { "token": "string" }, "brand": { "colors": { "property1": "string", "property2": "string" }, "text": { "font": "string", "fontSize": 12, "lineHeight": 1, "mobile": { "fontSize": 12, "lineHeight": 1 } }, "headings": { "h1": { "font": "string", "fontSize": 16, "lineHeight": 1, "mobile": { "fontSize": 16, "lineHeight": 1 }, "fontWeight": 400 }, "h2": { "font": "string", "fontSize": 14, "lineHeight": 1, "mobile": { "fontSize": 14, "lineHeight": 1 }, "fontWeight": 400 }, "h3": { "font": "string", "fontSize": 12, "lineHeight": 1, "mobile": { "fontSize": 12, "lineHeight": 1 }, "fontWeight": 400 } }, "links": { "color": "string", "underline": true }, "buttons": { "property1": { "background": "string", "color": "string", "border": { "color": "string", "width": 1 }, "font": "string", "fontSize": 12, "fontWeight": 400, "radius": 0, "paddingY": 4, "paddingX": 8, "mobile": { "fontSize": 12, "paddingY": 4, "paddingX": 8 } }, "property2": { "background": "string", "color": "string", "border": { "color": "string", "width": 1 }, "font": "string", "fontSize": 12, "fontWeight": 400, "radius": 0, "paddingY": 4, "paddingX": 8, "mobile": { "fontSize": 12, "paddingY": 4, "paddingX": 8 } } } } }, "sections": [ { "id": "string", "name": "string", "visibility": { "locales": [ "string" ], "hideOn": "mobile" }, "repeat": { "over": "string", "as": "string", "limit": 1 }, "type": "section", "background": { "token": "string" }, "contentBackground": { "token": "string" }, "backgroundImage": { "property1": "string", "property2": "string" }, "padding": [ 0, 0, 0, 0 ], "children": [ { "id": "string", "name": "string", "visibility": { "locales": [ "string" ], "hideOn": "mobile" }, "repeat": { "over": "string", "as": "string", "limit": 1 }, "type": "heading", "level": 1, "text": { "property1": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "string", "marks": [ {} ] } ] } ] }, "property2": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "string", "marks": [ {} ] } ] } ] } }, "style": { "font": "string", "fontSize": 0, "lineHeight": 0.8, "fontWeight": 400, "color": { "token": "string" }, "align": "left" }, "padding": [ 0, 0, 0, 0 ] } ] } ] } }}Get a template version GET
Previous Page
Render a template POST
The template as a recipient would get it, in one locale: its HTML and plain text, with the published brand kit and components, and what an email sending it would be refused for there. A version (the latest when absent), and a profile to fill it in for, strictly (a variable it doesn’t have is a 422); without one, empty values show their fallbacks.