Skip to content
Letterhead Letterhead Letterhead Help Center
Admin Tools

Change an automation's template

POST
/api/v3/automations/{automationUniqueId}/actions/change-template
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=abcdefhik

Using the v3 API, which requires a key generated from the company-level, this endpoint allows you to change the active template of an automation.

automationUniqueId
required
string

The automation’s unique identifier.

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
abcdefhik

200 Success

Media type application/json
object
items
string
nullable
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
nullable
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
nullable
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
nullable
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.