Segments

Create a segment

Create a DYNAMIC segment (a saved condition, re-evaluated against contacts on every read) or a STATIC one (an explicitly managed membership list). type is fixed at creation — it decides how membership is computed, so it cannot be changed later.

A DYNAMIC segment requires a condition, which is validated and evaluated during the request: the response's member_count tells you immediately how many contacts the filter actually matches.

Requires the segments:write scope — Create, edit, and delete your segments.

post/api/v1/segments

Request

  • Base URL: https://api.sendly.now
  • URL: https://api.sendly.now/api/v1/segments
  • Auth: one of:
    • HTTP bearer
    • API key in cookie better-auth.session_token
    • OAuth 2 (authorization code, authorization URL https://app.sendly.now/api/auth/oauth2/authorize, token URL https://app.sendly.now/api/auth/oauth2/token, scopes: segments:write)

Request body

descriptionstring
namestring required
track_membershipboolean

Emit segment entry/exit events as contacts move in and out. Off by default — it costs a membership write per transition.

type'DYNAMIC' | 'STATIC'

Response

Segment created

created_atstring date-time required
descriptionstring nullable required
idstring uuid required
member_countinteger required
namestring required
track_membershipboolean required
type'DYNAMIC' | 'STATIC' required
updated_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.