Skip to main content
Your system may already know that a customer doesn’t want marketing, and customers can also opt out through Pocketflows, from an email’s unsubscribe link or by replying STOP to a text. This guide covers both directions: telling Pocketflows about an opt-out, and finding out about one.

Tell Pocketflows a customer opted out

Of everything

To stop every campaign and trigger from reaching a customer, now and in the future, unsubscribe them with the future type:
Any campaign or trigger the customer is part of stops for them straight away. Afterwards the customer’s unsubscribed value is future.
The all type is narrower than its name suggests: it unsubscribes the customer only from the campaigns and triggers they are part of right now, and new campaigns and triggers can still reach them. To opt a customer out of everything, use future.

Of one campaign or trigger

Use "type": "campaign" with a campaign_id for a campaign.

Undo an opt-out

Resubscribe the customer with POST /customers/:id/resubscribe. It accepts the future, campaign and trigger types:
  • To undo future, resubscribe with future. This doesn’t undo unsubscribes from individual campaigns or triggers.
  • To undo a single campaign or trigger, resubscribe with campaign and a campaign_id, or trigger and a trigger_id. While the customer is unsubscribed with future, this returns 422: resubscribe them with future first.
  • To undo all, there is no all type to resubscribe with. An all unsubscribe is recorded as one unsubscribe for each campaign and trigger the customer was part of, so call GET /customers/:id/unsubscribe_info and resubscribe the customer to each campaign in unsubscribed_campaigns and each trigger in unsubscribed_triggers.

How customers opt out through Pocketflows

  • Email. By default, emails from campaigns and triggers include an unsubscribe link, and supported senders also add a one-click unsubscribe header for mail apps. Either way, the customer is unsubscribed with the future type.
  • SMS. When a customer replies STOP, Pocketflows adds them to the unsubscribe list of the phone number they replied to, and texts from that number skip them. Replying START removes them again. STOP doesn’t change the customer’s unsubscribed value.
Syncing a customer doesn’t undo either kind of opt-out.

Find out when a customer unsubscribes

Subscribe to the customer.unsubscribe webhook event. It’s sent when a customer unsubscribes through an email link, through an unsubscribe embed, or through the API. It is not sent when a customer replies STOP to a text. To check a single customer, call GET /customers/:id/unsubscribe_info. unsubscribed_from_all is true when the customer is unsubscribed with future, and unsubscribed_campaigns and unsubscribed_triggers list any individual unsubscribes.

Build your own unsubscribe page

To let customers opt out inside your product, create an unsubscribe embed for the customer and show its URL:
The response includes a url for a hosted page with an “Unsubscribe from all” button, which you can link to or show in an iframe. Submitting it unsubscribes the customer with the future type.