Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dacard.ai/llms.txt

Use this file to discover all available pages before exploring further.

Public route used by the unsubscribe link in transactional and ritual emails. Token-bound; no auth required. Tokens are minted per recipient on first email and persisted in email_preferences.

GET (preview)

curl -X GET "https://app.dacard.ai/api/unsubscribe?token=usb_..."
Returns the email address the token belongs to and the current preference state. Used by the unsubscribe landing page.

POST (commit)

curl -X POST https://app.dacard.ai/api/unsubscribe \
  -H "Content-Type: application/json" \
  -d '{
    "token": "usb_...",
    "categories": ["product_updates", "ritual_emails"],
    "all": false
  }'
PropertyValue
AuthNot required (token is the binding)
IdempotentYes

Body

FieldTypeRequiredNotes
tokenstringyesThe token from the email link.
categoriesstring[]noCategories to opt out of.
allbooleannoIf true, opts out of all marketing categories. Transactional emails still send.

Categories

product_updates, ritual_emails, score_decay_reminders, peer_benchmark_updates, weekly_digest. Transactional categories (account, billing, security) cannot be opted out of.

Errors

StatusCodeWhen
400Token requiredNo token.
404Token invalidBad or aged-out token.
500INTERNAL_ERRORWrite failed.
Source: PR #368 reworked this to mint real tokens (the prior implementation substituted the literal string placeholder, breaking CAN-SPAM compliance).