Change an automation's template
POST
/api/v3/automations/{automationUniqueId}/actions/change-template
const url = 'https://api.tryletterhead.com/api/v3/automations/example/actions/change-template';const form = new FormData();form.append('api', 'true');form.append('templateId', 'abcdefhik');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/automations/example/actions/change-template \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form api=true \ --form templateId=abcdefhikUsing the v3 API, which requires a key generated from the company-level, this endpoint allows you to change the active template of an automation.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” automationUniqueId
required
string
The automation’s unique identifier.
Request Body required
Section titled “Request Body required ” Media type multipart/form-data
object
api
required
When set to true, this endpoint will accept authorization with your API Key.
string
Example
true templateId
required
The identifier of the template to set for the automation.
string
Example
abcdefhikResponses
Section titled “ Responses ”200 Success
Media type application/json
object
items
string
message
string
total
integer
Example
{ "items": null, "message": "Automation template has been updated", "total": 0}400 Template not found
Media type application/json
object
items
string
message
string
total
integer
Example
{ "items": null, "message": "Template with ID {templateId} not found.", "total": 0}404 Automation not found
Media type application/json
object
items
string
message
string
total
integer
Example
{ "items": null, "message": "RecordNotFoundException — \"Automation with unique ID {uniqueId} not found.\"", "total": 0}422 Automation not in error state
Media type application/json
object
items
string
message
string
total
integer
Example
{ "items": null, "message": "Cannot change template for automation {uniqueId}: automation is not in error state.", "total": 0}Still can’t find what you need? Contact support.