API referenceEmail Components
Restore a email component version
Saves a copy of an older version as the new draft; publish it to use it.
POST
Saves a copy of an older version as the new draft; publish it to use it.
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
"draft""published""archived"draftVersionId*stringFormat
uuidpublishedVersionId*|Format
uuidhasUnpublishedChanges*booleancreatedAt*stringFormat
date-timeupdatedAt*stringFormat
date-timearchivedAt*|Format
date-timelevel*stringValue in
"block""section"locales*array<string>thumbnailUrl*|Format
uridraft*curl -X POST 'https://api.postforge.dev/v1/email-components/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": "draft", "draftVersionId": "e7fc80a1-b65e-482e-8fcd-f6c647b4104b", "publishedVersionId": "9786f1b1-ef7e-4f6a-94c4-c8eb67e924eb", "hasUnpublishedChanges": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archivedAt": "2019-08-24T14:15:22Z", "level": "block", "locales": [ "string" ], "thumbnailUrl": "http://example.com", "draft": { "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": { "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": { "property1": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "string", "marks": [ { "type": "bold" } ] } ] } ] }, "property2": { "type": "doc", "content": [ { "type": "paragraph", "content": [ { "type": "text", "text": "string", "marks": [ { "type": "bold" } ] } ] } ] } }, "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 } } ] } } }}Publish a email component version POST
Makes the version the one in use, after the checks before publish (422 with the problems found).
Get what a component is drawn with GET
Like a template’s inputs: the published brand kit (or its defaults), where its files are, the published components inside its draft and the workspace’s custom fields, for drawing it while it’s edited (D112).