Get an automation notification email preference
const url = 'https://api.tryletterhead.com/api/v3/automations/email-preferences?channelId=1&eventSlug=example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.tryletterhead.com/api/v3/automations/email-preferences?channelId=1&eventSlug=example' \ --header 'Authorization: Bearer <token>'Automations are one of several events Letterhead can email a teammate about — this and the
matching PUT endpoint read and set the signed-in user’s email notification preference for one
event at a time. eventSlug accepts the two automation events
(automation_deactivated, automation_template_reactivated) as well as Letterhead’s other
notification events (imports/exports finishing, a review being requested, an AI text generation
failing, new comments, a duplicate email being detected, an RSS feed failure, a system or webhook
failure, a goal being reached, and an Analyze agent finishing).
This reads 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 ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The internal numeric id of the channel the notification is scoped to.
The notification event, e.g. automation_deactivated or automation_template_reactivated.
Responses
Section titled “ Responses ”200 OK
object
object
Whether the user receives this notification by email. If the user has never chosen, this reports the event’s default (on for automation_deactivated) rather than reading a row that doesn’t exist yet.
Example
{ "items": { "eventSlug": "automation_deactivated", "enabled": true }, "message": "Preferences fetched successfully.", "total": 1}Still can’t find what you need? Contact support.