Copy Template
POST/print-mail/v1/templates/{id}/copy
Copy a template, including its template editor design and format settings. The template is found by ID in your organization, in whichever mode it’s in. By default the copy is created in your organization, in the mode of your API key, so an empty body duplicates the template. The copy keeps the template’s description and metadata.
A test API key only finds test templates and can only copy into test mode. A live API key can copy between test and live mode in either direction.
A template that uses trackers or a custom envelope can only be copied within your organization and the same mode, where the copy uses the same trackers and envelope. Images keep their URLs.
Copy Template
curl https://api.postgrid.com/print-mail/v1/templates/$ID/copy \
-H 'Content-Type: application/json' \
-H "X-API-Key: $POSTGRID_PRINT_MAIL_API_KEY" \
-d '{}'{
"id": "template_tBnVEzz878mXLbHQaz86j8",
"object": "template",
"live": false,
"description": "Test",
"html": "<b>Hello</b> {{to.firstName}}!",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}Returns Examples
{
"id": "template_tBnVEzz878mXLbHQaz86j8",
"object": "template",
"live": false,
"description": "Test",
"html": "<b>Hello</b> {{to.firstName}}!",
"createdAt": "2020-11-12T23:23:47.974Z",
"updatedAt": "2020-11-12T23:23:47.974Z"
}