API referenceEmails
Get what an email is drawn with
As for a template: the published brand kit, where its files are, the published components it uses and the workspace’s custom fields.
GET
As for a template: the published brand kit, where its files are, the published components it uses and the workspace’s custom fields.
apiKey readheader
AuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: read
id*stringMatch
^(email)_[0-9A-Za-z]{8}$OK
application/json- response
brandKit*brandKitVersionId*|Format
uuidassetUrls*components*componentNames*customFields*array<>curl -X GET 'https://api.postforge.dev/v1/emails/string/inputs'{ "brandKit": { "logo": { "assetId": "string", "darkAssetId": "string" }, "colors": { "roles": { "background": "string", "surface": "string", "text": "string", "muted": "string", "primary": "string", "on_primary": "string", "secondary": "string", "on_secondary": "string", "border": "string" }, "custom": [ { "key": "string", "label": "string", "value": "string" } ] }, "fonts": [ { "key": "string", "font": { "source": "system", "family": "Arial" } } ], "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": [ { "key": "string", "label": "string", "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 } }, { "key": "string", "label": "string", "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 } }, { "key": "string", "label": "string", "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 } }, { "key": "string", "label": "string", "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 } } ], "footer": { "companyName": "string", "postalAddress": "string", "note": { "property1": "string", "property2": "string" } }, "socials": { "links": [ { "network": "instagram", "url": "http://example.com" } ], "iconStyle": "color" } }, "brandKitVersionId": "3b9a8a08-c7ae-486b-89c3-d6e86a124ded", "assetUrls": { "property1": "http://example.com", "property2": "http://example.com" }, "components": { "property1": { "level": "block", "locales": [ "string" ], "description": "string", "props": [ { "type": "text", "default": { "property1": "string", "property2": "string" }, "key": "string", "label": "string", "description": "string", "required": true } ], "slots": [ { "key": "string", "label": "string", "min": 0, "max": 1 } ], "body": { "kind": "nodes", "nodes": [ { "id": "string", "name": "string", "visibility": { "locales": [ "string" ], "hideOn": "mobile" }, "repeat": { "over": "string", "as": "string", "limit": 1 }, "type": "heading", "level": 1, "text": { "prop": "string" }, "style": { "font": "string", "fontSize": 0, "lineHeight": 0.8, "fontWeight": 400, "color": { "token": "string" }, "align": "left" }, "background": { "token": "string" }, "padding": [ 0, 0, 0, 0 ], "margin": [ 0, 0, 0, 0 ], "mobile": { "padding": [ 0, 0, 0, 0 ], "margin": [ 0, 0, 0, 0 ], "labelPadding": [ 0, 0 ], "fontSize": 0, "lineHeight": 0.8, "align": "left", "width": "full", "height": 0 } } ] } }, "property2": { "level": "block", "locales": [ "string" ], "description": "string", "props": [ { "type": "text", "default": { "property1": "string", "property2": "string" }, "key": "string", "label": "string", "description": "string", "required": true } ], "slots": [ { "key": "string", "label": "string", "min": 0, "max": 1 } ], "body": { "kind": "nodes", "nodes": [ { "id": "string", "name": "string", "visibility": { "locales": [ "string" ], "hideOn": "mobile" }, "repeat": { "over": "string", "as": "string", "limit": 1 }, "type": "heading", "level": 1, "text": { "prop": "string" }, "style": { "font": "string", "fontSize": 0, "lineHeight": 0.8, "fontWeight": 400, "color": { "token": "string" }, "align": "left" }, "background": { "token": "string" }, "padding": [ 0, 0, 0, 0 ], "margin": [ 0, 0, 0, 0 ], "mobile": { "padding": [ 0, 0, 0, 0 ], "margin": [ 0, 0, 0, 0 ], "labelPadding": [ 0, 0 ], "fontSize": 0, "lineHeight": 0.8, "align": "left", "width": "full", "height": 0 } } ] } } }, "componentNames": { "property1": "string", "property2": "string" }, "customFields": [ { "key": "string", "label": "string", "type": "text" } ]}Restore a email version POST
Saves a copy of an older version as the latest: the one in use.
Render an email POST
The email as a recipient would get it in one locale, as `templates.render` draws a template, with its subject and preview text filled in, and what sending it would be refused for there (a subject missing among them).