Creating subscriber segments

Subscriber segments are one of the core building blocks of a campaign, allowing you to target subscribers with particular attributes. They are essentially a list of subscribers and can be used as a destination for a notification. One important concept to undersatand about segments is dynamism

Dynamism

A segment has a dynamism field which dictates when a particular subscriber list is created for given segment.

A subscriber list is the “bucket”/list of subscribers which match your segment rules or otherwise

Each segment can have multiple buckets which link a notification to a particular subscriber list. So lets say you create a segment and want to create the subscriber list at time of creating this segment, this can be done by omitting the dynamism field altogether. A segment bucket is created and the list of subscribers which match your segment is created. This way every single notification which has this segment associcated with it will use this same subscriber list. However lets say you create a segment but as time rolls on you get new devices which install your app, the subscriber list created by this segment will be stale. So dynamism allows you to accomodate this scenario. There are two supported dynamism types:

There are two ways of creating a segment

  1. create empty segment and assign list of subscribers yourself manually. NOTE this method does not support dynamism
  2. create a segment with rules which will be used to filter subscribers

Manually creating segments

Steps required are as follows:

Create empty segment

First lets create a named segment by calling following endpoint:

HTTP callSample POST body

POST /v1/segment

Once this call is made we now have an empty segment to which we will assign our select subscribers. Response of this call will contain segment id value that we will need to use later.

Note: You can always see all your existing segments by calling:

Shell