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.