Newsletters

Overview

Newsletters track email subscription consent for marketing communications. Each record stores the subscriber's email, consent details, and which lists they've subscribed to.


How It Works

  1. Collect consent - Capture email and consent when a visitor subscribes to your newsletter
  2. Assign to lists - Organize subscribers into different mailing lists
  3. Track source - Record where the subscription originated for compliance

Example: A visitor enters their email in your footer signup form. Create a newsletter record with their email, the consent URL, and assign them to your "Weekly Updates" list.


API Endpoints

MethodEndpointDescription
GETList newslettersRetrieve a paginated list of newsletter subscribers
POSTCreate newsletterCreate a new newsletter subscriber
GETGet newsletterRetrieve a specific newsletter subscriber
PUTUpdate newsletterUpdate a newsletter subscriber
DELETEDelete newsletterPermanently delete a newsletter subscriber

Important Behaviors

  • Source normalization: The source field is automatically lowercased before storage. Submitting Web stores as web.
  • Hard delete: Deleting a newsletter permanently removes the record and all its history. This is not reversible.
  • Consent defaults: When consent_url, consent_ip, consent_text, or consent_type are omitted on create/update, they are stored as empty strings ("") not null.
  • Email uniqueness: Email must be unique per site. Duplicate emails on different sites are allowed.
  • Update requires email + source: Both email and source are required on every update call, not just on create.

Source Values

ValueDescription
webSigned up via website
phoneSigned up via phone
mailSigned up via physical mail
otherOther source

Newsletter Object

AttributeTypeDescription
idintegerUnique identifier for the newsletter subscriber
emailstringSubscriber's email address (unique per site)
first_namestring|nullSubscriber's first name
last_namestring|nullSubscriber's last name
sourcestringSignup source: web, phone, mail, or other
listsstring|nullFree-text field for list assignments (no format enforced)
consent_urlstringURL where consent was given (defaults to "")
consent_ipstringIP address when consent was given (must be valid IPv4/IPv6, defaults to "")
consent_textstringConsent text shown to subscriber (defaults to "")
consent_typestringType of consent given (defaults to "")
postal_codestring|nullSubscriber's postal code (max 10 chars)
created_atintegerUnix timestamp of creation
updated_atintegerUnix timestamp of last update