Newsletters

Receive notifications when newsletter subscriptions are created or updated.

Overview

Newsletter webhooks notify your application when newsletter subscriptions are created or modified. Use these events to sync subscriber data with your email marketing platform or mailing list provider.


Use Cases

  • Sync new subscribers to your email service provider (Mailchimp, SendGrid, etc.)
  • Update subscriber preferences when mailing list selections change
  • Track consent information for GDPR compliance
  • Trigger welcome emails for new newsletter sign-ups
  • Maintain an external subscriber database

Events

EventDescription
newsletter.createdA new newsletter subscription was created
newsletter.updatedAn existing newsletter subscription was modified

newsletter.created

Triggered When

  • A visitor subscribes to a newsletter via the SDK
  • A newsletter subscription is created via the Core API

Payload

{
  "type": "newsletter.created",
  "id": "evt_a1B2c3D4e5F6g7H8i9J0k1L2",
  "created": 1704067200,
  "data": {
    "object": {
      "id": 100001,
      "site_id": 1,
      "consent_type": "",
      "consent_text": "",
      "consent_ip": "",
      "consent_url": "",
      "lists": "emlBreakingNewsAlerts,emlDailyAlerts,promoteEditorial,promoteEvents",
      "source": "",
      "email": "[email protected]",
      "first_name": null,
      "last_name": null,
      "postal_code": null,
      "created_at": "2026-01-01T12:00:00.000000Z",
      "updated_at": "2026-01-01T12:00:00.000000Z",
      "deleted_at": null,
      "object": "newsletter"
    }
  }
}

newsletter.updated

Triggered When

  • A subscriber updates their newsletter preferences via the SDK
  • A newsletter subscription is updated via the Core API

Payload

The payload includes a previous_attributes object containing only the fields that changed.

{
  "type": "newsletter.updated",
  "id": "evt_b2C3d4E5f6G7h8I9j0K1l2M3",
  "created": 1704153600,
  "data": {
    "object": {
      "id": 100001,
      "site_id": 1,
      "consent_type": "explicit",
      "consent_text": "I agree to receive newsletters",
      "consent_ip": "203.0.113.50",
      "consent_url": "https://www.example.com/",
      "lists": "emlDailyDigest,emlWeeklySummary,emlBreakingNews",
      "source": "web",
      "email": "[email protected]",
      "first_name": "Jane",
      "last_name": "Doe",
      "postal_code": null,
      "created_at": "2024-05-15T10:30:00.000000Z",
      "updated_at": "2026-01-02T12:00:00.000000Z",
      "deleted_at": null,
      "object": "newsletter"
    },
    "previous_attributes": {
      "consent_url": "https://www.example.com/news/article-title"
    }
  }
}

Payload Fields

Newsletter Object

FieldTypeDescription
objectstringObject type identifier, always newsletter
idintegerUnique identifier for the newsletter subscription
site_idintegerSite the subscription belongs to
emailstringSubscriber email address
first_namestring | nullSubscriber first name
last_namestring | nullSubscriber last name
postal_codestring | nullSubscriber postal/zip code
listsstring | nullComma-separated list of subscribed mailing lists. null when fully unsubscribed
sourcestringHow the subscription was created (e.g., web, empty string if not set)
consent_typestringType of consent given (e.g., explicit, empty string if not set)
consent_textstringConsent text the subscriber agreed to
consent_ipstringIP address at time of consent
consent_urlstringURL where consent was given
created_atstringISO 8601 timestamp when the subscription was created
updated_atstringISO 8601 timestamp when the subscription was last modified
deleted_atstring | nullISO 8601 timestamp if soft-deleted, otherwise null

Previous Attributes (newsletter.updated only)

FieldTypeDescription
previous_attributesobjectContains only the fields that changed, with their previous values before the update

Related