A subscription is a named opt-in channel a user can subscribe to or unsubscribe from. Most projects need at least one per delivery channel (Marketing email, Transactional SMS, Product push) and many add topic-level subscriptions on top. Spotzee separates subscription types (configured by admins) from subscription states (per-user values).Documentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
Subscription types live under Settings → Subscriptions and require the project
admin role. Per-user state changes can come from the in-product preference centre, the public PATCH /subscriptions/me endpoint, or the server-side bulk toggle endpoint.What a subscription type is
Each subscription type carries three attributes:- Name. What users see in unsubscribe links and preference centres (for example,
Marketing email,Promotional SMS,Product updates). - Channel. One of
email,text(SMS),push,webhook, orin_app. A subscription is bound to exactly one channel. - Public visibility. When on, the subscription appears in the customer-facing preference centre. When off, the subscription is internal-only (you control state from the server).
- One per channel:
Marketing email,Marketing SMS,Marketing push. - Topic-level:
Newsletter,Product updates,Onboarding tips,Account alerts. - Tier-aware:
Free-tier email,Premium-tier email(when content differs by plan).
The three states
Per-user, each subscription has one of three states:| State | Meaning | Spotzee will send |
|---|---|---|
subscribed | User has opted in | Yes |
unsubscribed | User has opted out | No |
opted_in | User actively confirmed (double opt-in) | Yes (some flows treat this stricter than plain subscribed) |
subscribed for non-public subscription types (so internal flows reach everyone) and as no-state for public types until the user actively opts in.
Create a subscription type
Create a new subscription
Choose Create subscription, then complete:
- Name (for example,
Marketing email). - Channel (
email,text,push,webhook, orin_app). - Public. Toggle on if users should see this subscription in their preference centre. Off for internal-only types.
Let users manage their own preferences
ThePATCH /subscriptions/me endpoint is purpose-built for browser-side preference centres. It accepts a publishable key and a user session token, so the call is safe to make from a customer’s browser without exposing a secret key.
Mint a user session token
From your server, call
POST /users/{userId}/sessions with a secret key (sk_…) to mint a short-lived user session token bound to the user.Hand the token to your front-end
Pass the token to your preference-centre page along with your publishable key (
pk_…).Toggle subscriptions from the browser
Call State values follow the encoding above:
PATCH /subscriptions/me with Authorization: Bearer pk_..., X-Spotzee-User-Token: <session token>, and a body of toggle items:0 for unsubscribed, 1 for subscribed, 2 for opted-in. Up to 100 toggles per request. Toggling to the current state is a no-op.Bulk-toggle from your server
When you need to flip subscription state across many users, usePOST /subscriptions/batch with a secret key. Each item identifies its target by external_id or anonymous_id. Per-item errors are returned so a single failed lookup doesn’t hold up the rest of the batch.
Unsubscribe links and SMS opt-out
Some opt-out flows happen automatically:- Email unsubscribe links. Spotzee inserts a one-click unsubscribe link into outbound HTML emails when the recipient is subscribed to a
Publicemail subscription. Clicking the link recordsunsubscribedfor that subscription. - SMS keywords. Replies of
STOP,UNSUBSCRIBE,CANCEL,END, orQUITmark the user asunsubscribedfor the project’s primary SMS subscription. Spotzee then sends back the configured SMS opt-out message (set under Settings → General → Push and SMS). - Help keywords. Replies of
HELPsend back the configured SMS help message. Help responses don’t change subscription state.
Next steps
Set up a project
Configure SMS opt-out and help messages for keyword replies.
Sync users
Push user data into a project.
Manage API keys
Issue publishable and secret keys for preference-centre flows.
Authentication
The conceptual model for
pk_ plus user session token combinations.