WhatsApp subscriptions in Blueshift are managed at the sender level — each WhatsApp sender number tracks opt-ins and opt-outs independently. You can subscribe or unsubscribe customers using identify events, data imports, or the API. Customers can also opt out at any time by replying with a keyword.
Before managing subscriptions, make sure you have a connected WhatsApp adapter. See Set up the WhatsApp Native Integration.
Identify events
Send an identify event to subscribe or unsubscribe a customer in real time. Set whatsapp_subscribed to true to subscribe or false to unsubscribe. Include whatsapp_sender_number to specify which WhatsApp sender the preference applies to.
Subscribe
The following is a sample payload to subscribe a customer:
{
"event": "identify",
"email": "john.smith@example.com",
"whatsapp_subscribed": true,
"whatsapp_sender_number": "+12025550143"
}Unsubscribe
The following is a sample payload to unsubscribe a customer:
{
"event": "identify",
"email": "john.smith@example.com",
"whatsapp_subscribed": false,
"whatsapp_sender_number": "+12025550143"
}Multiple senders
To update a customer's subscription for multiple WhatsApp senders in a single event, use the nested whatsapp_preferences format:
{
"event": "identify",
"email": "john.smith@example.com",
"whatsapp_preferences": [
{
"subscribed": true,
"sender_number": "+12025550143"
},
{
"subscribed": false,
"sender_number": "+12025550199"
}
]
}For details on sending identify events, see Send events from your site or app.
Data imports
Update subscriptions in bulk using a CSV or data import. Map your file to the following attributes:
| Attribute | Type | Description |
|---|---|---|
whatsapp_subscribed |
Boolean |
true to subscribe, false to unsubscribe |
whatsapp_sender_number |
String | The WhatsApp sender number in E.164 format (for example, +12025550143) |
API
Update subscriptions programmatically using the following APIs. Use the same whatsapp_subscribed and whatsapp_sender_number attributes as shown in the identify event examples above.
- Create or update customer
- Bulk create or update customers
-
Send an event (using
identifyevent) -
Send bulk events (using
identifyevent)
Keyword-based opt-in and opt-out
When a customer replies to a WhatsApp message with one of the following keywords, Blueshift automatically updates their subscription status for that sender. Matching is case-insensitive and applies to the full message body.
| Action | Keywords |
|---|---|
| Opt out |
STOP, UNSUBSCRIBE
|
| Opt in |
START, SUBSCRIBE, UNSTOP
|
Templates can also include a quick reply button configured as an opt-out trigger. When a customer taps the button, Blueshift unsubscribes them from that sender.
View subscription status
After a subscription is updated, the customer's WhatsApp preference is visible on their customer profile.
Comments
0 comments