---
title: "Unsubscribe from marketing email using a token from a message"
method: POST
path: "/api/email/unsubscribe/{token}"
tags: ["email"]
---

# Unsubscribe from marketing email using a token from a message

`POST /api/email/unsubscribe/{token}`

## 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/email/unsubscribe/{token}`
- Auth: none declared

Withdraw marketing consent. No session, no CSRF, idempotent.

The whole mutation is one short transaction: flip the flag, append the
provenance, mark the ESP owed a contact deletion. The provider is never
called from here — the standing drain (task 11 E4) is what talks to
Resend, on the far side of a commit, exactly as the deletion tails do.

## Path parameters

- `token` string, required

## Response `200`

Successful Response

- UnsubscribeView: What the route says, which is the same thing in every case. ``marketing_opted_in`` is always ``False`` and is here because the caller asked for exactly one outcome and this states it: after this request, this token's account receives no marketing mail. It is a constant rather than a read-back on purpose — a field that varied would re-open the oracle the identical status codes close, by telling an unknown token apart from a known one that was already unsubscribed.
  - `marketing_opted_in` boolean

## Other responses

- `422`: Validation Error
- `429`: Too Many Requests

---

[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)
