- Dynamic — membership is evaluated on-the-fly using filter conditions against contact data and event history.
- Static — membership is managed manually by adding or removing specific email addresses.
All segment endpoints require a secret key (
sk_*).Filter condition schema
Dynamic segments use a nestedFilterCondition object to define who belongs to the segment.
Available operators
| Operator | Description |
|---|---|
equals | Exact match |
notEquals | Does not match |
contains | String contains value |
notContains | String does not contain value |
greaterThan | Numeric greater than |
lessThan | Numeric less than |
greaterThanOrEqual | Numeric greater than or equal |
lessThanOrEqual | Numeric less than or equal |
exists | Field is present and non-null |
notExists | Field is absent or null |
within | Date is within the last N unit (days/hours/minutes) |
olderThan | Date is older than N unit |
triggered | Event was tracked at least once |
triggeredWithin | Event was tracked within the last N unit |
triggeredOlderThan | Event was last tracked more than N unit ago |
notTriggered | Event has never been tracked |
within, olderThan, triggeredWithin, triggeredOlderThan) also provide:
value— the numeric amountunit— one ofdays,hours, orminutes
List segments
GET /segments
Returns all segments for the authenticated project.
Example
200
Create segment
POST /segments
Creates a new segment.
Body parameters
Segment name.
Segment type:
DYNAMIC or STATIC.Filter condition defining dynamic membership. Required when
type is DYNAMIC.Optional description.
When
true, Plunk tracks when contacts enter and exit this segment and fires segment.<slug>.entry / segment.<slug>.exit system events that can trigger workflows.Get segment
GET /segments/:id
Retrieves a single segment by ID, including its current member count.
Path parameters
The segment ID.
Example
Update segment
PATCH /segments/:id
Updates a segment’s name, description, filter condition, or membership tracking setting.
Path parameters
The segment ID.
Body parameters
Segment name.
Segment description.
Updated filter condition object.
Enable or disable membership tracking.
Example
Delete segment
DELETE /segments/:id
Permanently deletes a segment.
Path parameters
The segment ID.
204 No Content on success.
Example
List contacts in segment
GET /segments/:id/contacts
Returns a paginated list of contacts that currently belong to the segment.
Path parameters
The segment ID.
Query parameters
Page number (1-indexed).
Contacts per page. Maximum
100.Example
Add contacts to static segment
POST /segments/:id/members
Adds contacts to a static segment by email address. Creates any contacts that do not yet exist.
Path parameters
The segment ID. The segment must be of type
STATIC.Body parameters
Array of email addresses to add to the segment.
Example
Remove contacts from static segment
DELETE /segments/:id/members
Removes contacts from a static segment by email address.
Path parameters
The segment ID. The segment must be of type
STATIC.Body parameters
Array of email addresses to remove from the segment.
Example