Create Custom Segment

Required parameters

ParameterLocationTypeRequiredDescription
nameBodystringYesSegment name.
refreshTypeBodyintegerYesSegment type. Use 1 for Static and 2 for Dynamic.

Body fields

FieldTypeRequiredDescription
namestringYesSegment name.
refreshTypeintegerYesUse 1 for Static or 2 for Dynamic.
groupsarray of objectsConditionallyA set of filtering condition groups used to filter contacts. Required when refreshType = 2. Optional when refreshType = 1, but for static segments you must provide either groups or contactIds.
contactIdsarrayConditionallyList of contact IDs used to directly define members in a static segment. For static segments, provide contactIds or groups.
useUploadedContactbooleanNoIndicates whether to use the uploaded contacts logic for the downstream CDP segment API. Defaults to false when not provided.

Group structure

Each item in groups contains a conditions array.

Each condition includes:

  • attribute — field name, such as a contact field or custom attribute like name or phone
  • operator — comparison operator, such as ==
  • value — comparison value