Update an automation notification email preference
const url = 'https://api.tryletterhead.com/api/v3/automations/email-preferences';const form = new FormData();form.append('channelId', '1');form.append('eventSlug', 'automation_deactivated');form.append('enabled', 'true');
const options = {method: 'PUT', 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 PUT \ --url https://api.tryletterhead.com/api/v3/automations/email-preferences \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form channelId=1 \ --form eventSlug=automation_deactivated \ --form enabled=trueSubscribe or unsubscribe the signed-in user from one notification eventβs emails. See the
matching GET endpoint above for the full list of accepted eventSlug values. The choice is
always stored as a row (never deleted), so it stays distinguishable from βnever choseβ and can
turn off an event thatβs on by default.
This changes the current userβs own preference, so it authenticates as a signed-in user rather than a company API key and is not available to external integrations.
Authorizations
Section titled βAuthorizations βRequest Body required
Section titled βRequest Body required βobject
The internal numeric id of the channel the notification is scoped to.
The notification event, e.g. automation_deactivated or automation_template_reactivated.
Whether the user should receive this notification by email.
Responses
Section titled β Responses β200 OK
object
Example
{ "items": null, "message": "Preference updated successfully.", "total": 0}Still can’t find what you need? Contact support.