Skip to main content
POST
Create a segment

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

Project ID

Body

application/json
name
string
required

Segment name.

Minimum string length: 1
bizType
enum<string>
required

What the segment groups: user or company. Immutable.

Available options:
user,
company
kind
enum<string>
required

Segment kind. Immutable.

Available options:
condition,
manual
conditions
object[]

Membership conditions (condition segments only) — ATTRIBUTE conditions and groups of them, nothing else (a segment is an attribute query). Multiple top-level conditions are ANDed — [A, B] means A AND B; for OR wrap them in one { "type": "group", "match": "any", "conditions": [A, B] }, same as content rules. For "users who did X" audiences, store the fact as an attribute too and segment on that, or put the event condition on the content's start rules.

Response

Segment created

id
string
required
object
enum<string>
required
Available options:
segment
name
string
required
bizType
enum<string>
required
Available options:
user,
company
kind
enum<string>
required

all = the built-in everyone segment (one per bizType; immutable, cannot be deleted); condition = membership computed from conditions; manual = explicit member list.

Available options:
all,
condition,
manual
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
conditions
object[]

Present on condition segments (decompiled to stable attribute codes). Top-level siblings are ANDed; an OR lives inside a match:"any" group — same rules as writes.

memberCount
number

Members in the requested environment — only on GET one segment with expand=memberCount (+ environmentId); the list endpoint never returns it. manual = explicit members; condition = users/companies matching the conditions right now; all = everyone in the environment. Counted with the SAME filter the users/companies list applies for segmentId, so the two always agree.