API referenceTemplates
Create a template
Its first version is in use right away.
POST
Its first version is in use right away.
apiKey writeheader
AuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: write
idempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
Length
1 <= length <= 255application/json- body
name*stringLength
1 <= length <= 200definition*folderId?|Format
uuidDefault
nullCreated
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' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "definition": { "locales": [ "string" ], "settings": { "width": 320 }, "sections": [ { "id": "string", "type": "section", "children": [ { "id": "string", "type": "heading", "level": 1, "text": { "property1": { "type": "doc", "content": [ { "type": "paragraph" } ] }, "property2": { "type": "doc", "content": [ { "type": "paragraph" } ] } } } ] } ] }}'{ "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 ] } ] } ] } }}