Reactivate and restart an automation
const url = 'https://api.tryletterhead.com/api/v3/automations/example/actions/reactivate-and-restart';const form = new FormData();form.append('api', 'true');
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/reactivate-and-restart \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form api=trueThis endpoint restarts an automation that stopped because its template was switched off — for example, someone didn’t republish a change as part of editorial and the automation disabled itself. Yep - this is a pretty specific use-case. The unpublished template will be published and then subsequently available to future automation use - and then the automation itself will be re-enabled.
The automation resumes on its normal schedule. No newsletter is sent by this call. If the automation hasn’t stopped on an error, nothing changes and the call returns 200. An automation that stopped for any other reason (for example, no template selected, repeated content, a deleted segment, or an unavailable email provider connection) cannot be reactivated this way and returns 422 with a message naming what to fix first.
Our v3 endpoints require a company-level API key.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The automation’s unique identifier.
Request Body required
Section titled “Request Body required ”object
When set to true, this endpoint will accept authorization with your API Key.
Example
trueResponses
Section titled “ Responses ”200 - The automation is already active, so nothing changed
object
Example
{ "items": null, "message": "This automation is already active, so there was nothing to reactivate.", "total": 0}202 - Reactivated and restarted
object
Example
{ "items": null, "message": "Automation reactivated. It will resume on its normal schedule -- no newsletter was sent just now.", "total": 0}422 - The automation stopped for a reason reactivation can’t clear. The message names what to fix first.
object
Example
{ "message": "This automation needs a newsletter template selected before it can be reactivated."}Still can’t find what you need? Contact support.