Email unsubscribe
Stop one kind of email from the link in the message.
Every Renzo email carries an unsubscribe link and a List-Unsubscribe header. These two calls act on that link. The signed token in the link is the only key, so no token or sign-in is needed. Anyone who holds the link may call them.
Endpoints
| Operation | What it does | Auth |
|---|---|---|
POST/ | Stop the kind of email named by the link: {"token": "..."}. | None, the link token is the key |
POST/ | The one-click target that mail providers post to. Takes ?token=. | None, the link token is the key |
Example: unsubscribe from a summary
curl -X POST "$BASE/api/v1/email/unsubscribe" \
-H "Content-Type: application/json" \
-d '{"token": "eyJhbGciOi...example"}'The answer is 200:
{
"kind": "digest",
"type_key": "market.pre_market_summary",
"type_label": "Pre-market summary",
"alert_id": null,
"ticker": null
}Rules and edge cases
- Kinds.
kindisdigestfor a summary email, orprice_alertfor an alert email. - Digest. For
digest, the answer names the type that was turned off intype_keyandtype_label. Email is switched off for that type only. - Price alert. For
price_alert, the answer holdsalert_idandticker. Email is taken off that one alert, and its other channels keep firing. An alert that had only email is paused, so resuming it brings email back. See Price alerts. - Gone targets.
type_key,type_label,alert_idandtickerarenullwhen the type or the alert no longer exists. - Twice. Calling again answers the same.
- One-click.
POST /api/v1/email/one-click-unsubscribeis the RFC 8058 target. Mailbox providers post to it. Thetokenquery parameter (1 to 256 characters) is the only key. The form body is ignored. It answers200with{"unsubscribed": true}. - Bad link. A damaged token, or one Renzo did not issue, answers
400notification_unsubscribe_token_invalid. - Turn it back on. A signed-in customer can switch email on again in preferences. See Notifications.
Errors
| Code | Status | When |
|---|---|---|
notification_unsubscribe_token_invalid | 400 | The unsubscribe link is damaged or was not issued by Renzo. |
Request errors, such as validation_failed, can come from any call. See Errors.