Required: frameworkId. The template inherits the framework's content, description, tags, encoding, imageHandlingMode, variables and lifecycleStatus; use cmsTemplates/update to change them. name defaults to the framework's name.
The numeric ID of the framework to create the template from.
Optional. The name of the new template.
The newly created template.
Example response:
{
"id": 9168,
"name": "November newsletter",
"description": "Monthly newsletter template",
"content": "<html><body><div data-block-area=\"main\">#tplBlockArea(\"main\")</div></body></html>",
"tags": "newsletter",
"encoding": "UTF-8",
"imageHandlingMode": "none",
"variables": "{\"defaultBGColor\": {\"id\": \"def-bgColor\", \"name\": \"Default Background Color\", \"type\": \"text\", \"value\": \"#FFFFFF\", \"group\": \"System Defaults\", \"order\": 1, \"inline\": \"false\"}, \"imagetype\": {\"id\": \"314f6ef8-37df-470a-beea-6b630832df29\", \"name\": \"Image Link Settings\", \"type\": \"list\", \"value\": \"withlink\", \"options\": {\"Image w/ URL\": \"withlink\", \"Image w/o URL\": \"nolink\"}, \"group\": \"Variables\", \"order\": 2, \"inline\": \"false\"}}",
"lifecycleStatus": "ACTIVE",
"status": "WORKINPROGRESS",
"framework": {
"id": 9070,
"name": "Newsletter layout",
"lifecycleStatus": "ACTIVE"
},
"blocks": [
{
"blockInstanceId": "9405-387799208771704-175632977801977",
"blockId": 9405,
"name": "Welcome text",
"description": "Greeting used in onboarding mails",
"content": "<p style=\"background-color: ${defaultBGColor}\">Welcome to our newsletter</p>",
"renderedContent": null,
"variables": "{\"BLOCKVAR_9405-387799208771704-175632977801977_buttonColor_ENDBLOCKVAR\": {\"id\": \"325a8b38-e9aa-47f4-a47b-f0300e837fec\", \"name\": \"Button Colour\", \"type\": \"text\", \"value\": \"#0055AA\", \"group\": \"Button\", \"order\": 1, \"inline\": \"false\"}}",
"autoUpdate": false,
"encoding": "UTF-8"
}
],
"fallbackContent": null,
"groupId": null,
"messageCategoryId": null,
"createDate": 1792998000000,
"modifyDate": 1793001600000,
"version": 1
}
Error. All errors are returned as HTTP 400; errorCode in the body says what went wrong: INVALID_PARAMETER or MISSING_PARAMETER (a parameter is missing or invalid), NO_SUCH_OBJECT (no object with this ID in your account), PERMISSION_DENIED (your user lacks the CMS permission for this action), UNEXPECTED_ERROR (backend error). Example: {"errorActor": "CLIENT", "errorCode": "NO_SUCH_OBJECT", "message": "...", "objectType": null, "propertyName": null, "propertyValue": null}