veil

Stop the email notices from an email’s link

Opts a card out with the token of its emails’ stop link, without a key: n and t in the query (a mail program’s one-click POST, RFC 8058) or {"n", "token"} in the body.

POST/v1/notices/unsubscribe
Access
Creates temporary data
Client
Local or server client

Parameters#

NameLocationMeaning
nRequiredQueryCard number.
tRequiredQueryThe token of the stop link.

Request examples#

cURL
curl -fsS -X POST "https://veil.rip/v1/notices/unsubscribe?n=CARD_NUMBER&t=TOKEN"

Response#

HTTP 200application/json

The card’s number and on: false.

FieldTypeMeaning
nintegerCard number.
onbooleanAlways false.

Response headers#

HeaderValueMeaning
Content-Typeapplication/jsonUse the declared media type before choosing a parser.
DateHTTP dateServer time. Compare it with your clock when signing requests.
Retry-Afterinteger seconds, on rate_limited or busyWait at least this long before retrying. Other 429/503 codes do not necessarily include it.

Usage notes#

  • The token is the server’s Ed25519 signature for the card’s number, so it works only for that card. The emails link to the page /notices/stop with the number and the token after the #, so they never reach a log; opening that page changes nothing until the person presses the button.

Errors#

API errors return an error object. Use error.code for program logic; error.message is English text for people and can change. Response and error guide

HTTPCodeMeaning and next step
400invalid_parameter

A path, query or body field is missing, malformed or outside its accepted range.

Correct the field named in error.message before sending again.

403invalid_token

The stop link’s token is not the server’s signature for this card.

Copy the whole link from the email, or opt out from the account page.

Shared request errors
HTTPCodeMeaning and next step
429rate_limited

An anonymous, signed-request or API-key allowance was exceeded.

Wait at least Retry-After seconds. Share a queue and retry budget across your workers.

500internal_error

An unexpected server error occurred. Internal details are not returned.

Retry reads with bounded backoff. Check write results before sending a new signed operation.

503busy

The application has reached a temporary concurrency or database limit.

Wait Retry-After seconds and retry with bounded backoff.