Unsubscribe link

Add one-click unsubscribe with enable_unsubscribe on POST /emails—List-Unsubscribe headers and RFC 8058 POST support.

Marketing and newsletter email should include an easy opt-out. Set enable_unsubscribe: true on POST /emails and Piisend handles the rest.

What Piisend adds

When enable_unsubscribe is true:

  1. A signed unsubscribe URL is generated for each recipient.
  2. List-Unsubscribe and List-Unsubscribe-Post headers are added before delivery (Gmail/Yahoo one-click compliant).
  3. When the recipient unsubscribes, their address is added to your suppression list.

Step-by-step

1. Enable on send

{
  "to": ["subscriber@example.com"],
  "subject": "March newsletter",
  "html": "<p>Latest updates.</p>",
  "enable_unsubscribe": true
}

2. Recipient clicks Unsubscribe

Webmail clients show an unsubscribe button using the List-Unsubscribe header. The link points to Piisend's /unsubscribe/{token} endpoint.

3. Suppression is recorded

Both GET (link click) and POST (one-click) unsubscribe requests add the address to suppressions with source manual.

4. Future sends are blocked

Any subsequent POST /emails to that address is rejected before queueing.

When to use

  • Newsletters and promotional campaigns
  • Any mail where recipients did not explicitly request a one-off transactional message

Transactional mail (password reset, receipt) typically keeps enable_unsubscribe: false.

Related

Unsubscribe flowenable_unsubscribeList-UnsubscribeRecipient clicksSuppression added

Example request

curl -sS -X POST "https://api.piisend.com/api/v1/emails" \
  -H "Authorization: Bearer $PIISEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["subscriber@example.com"],
    "subject": "March newsletter",
    "html": "<p>Latest updates from our team.</p>",
    "enable_unsubscribe": true
  }'

Documentation

Integrate with the REST API

Quickstart, API reference, and webhooks—everything you need to send from your app.