---
title: "This account's mail preferences and the address they apply to"
method: GET
path: "/api/account/email-preferences"
tags: ["account"]
---

# This account's mail preferences and the address they apply to

`GET /api/account/email-preferences`

## Request

- Base URL: `https://app.nerdit.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.nerdit.ai/api/account/email-preferences`
- Auth: none declared

Read the preference row, creating it on this first read if need be.

The row is minted lazily rather than backfilled by the migration for
the reason ``email/preferences.py`` gives: a backfill would write a
bearer token for every account that predates the table, most of which
will never receive a marketing mail. So a read is a write, exactly
once, and the column defaults are what a missing row already meant.

## Response `200`

Successful Response

- EmailPreferencesView: This account's mail settings, and the address they apply to. Three fields, and the omissions matter as much as the fields: the unsubscribe token is a bearer credential and the ESP columns are an internal sync state, so neither is ever serialised here. A console that printed the token would turn every screenshot into a working unsubscribe link for somebody else's account.
  - `marketing_opted_in` boolean, required
  - `product_notifications` boolean, required
  - `email` string, required

## Other responses

- `401`: Unauthorized

---

[API](https://skmtc.dev/nerdit/apis/nerdit-cloud-web.md) · [All operations](https://skmtc.dev/nerdit/apis/nerdit-cloud-web/llms.txt) · [OpenAPI document](https://skmtc.dev/nerdit/apis/nerdit-cloud-web/revisions/06e3b44b58be?raw)
