Update an automation notification email preference
PUT
/api/v3/automations/email-preferences
const url = 'https://api.tryletterhead.com/api/v3/automations/email-preferences';const form = new FormData();form.append('channelId', '1');form.append('eventSlug', 'example');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=example \ --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 ” Media type multipart/form-data
object
channelId
required
The internal numeric id of the channel the notification is scoped to.
integer
eventSlug
required
The notification event, e.g. automation_deactivated or automation_template_reactivated.
string
enabled
required
Whether the user should receive this notification by email.
boolean
Responses
Section titled “ Responses ”200 OK
Media type application/json
object
items
string
message
string
total
integer
Example
{ "items": null, "message": "Preference updated successfully.", "total": 0}Still can’t find what you need? Contact support.