RenzoDocs

Email unsubscribe

Stop one kind of email from the link in the message.

View as Markdown

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

OperationWhat it doesAuth
POST/api/v1/email/unsubscribeStop the kind of email named by the link: {"token": "..."}.None, the link token is the key
POST/api/v1/email/one-click-unsubscribeThe 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:

Response
{
  "kind": "digest",
  "type_key": "market.pre_market_summary",
  "type_label": "Pre-market summary",
  "alert_id": null,
  "ticker": null
}

Rules and edge cases

  • Kinds. kind is digest for a summary email, or price_alert for an alert email.
  • Digest. For digest, the answer names the type that was turned off in type_key and type_label. Email is switched off for that type only.
  • Price alert. For price_alert, the answer holds alert_id and ticker. 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_id and ticker are null when the type or the alert no longer exists.
  • Twice. Calling again answers the same.
  • One-click. POST /api/v1/email/one-click-unsubscribe is the RFC 8058 target. Mailbox providers post to it. The token query parameter (1 to 256 characters) is the only key. The form body is ignored. It answers 200 with {"unsubscribed": true}.
  • Bad link. A damaged token, or one Renzo did not issue, answers 400 notification_unsubscribe_token_invalid.
  • Turn it back on. A signed-in customer can switch email on again in preferences. See Notifications.

Errors

CodeStatusWhen
notification_unsubscribe_token_invalid400The unsubscribe link is damaged or was not issued by Renzo.

Request errors, such as validation_failed, can come from any call. See Errors.

Reference

On this page