Skip to content

Segments - Create a new segment

POST
/segments/v2/{bucket}/create

Segments are groups of records that can be used for browsing or bulk actions. A segment can be thought of as a stored query or view in traditional database terms. This endpoint creates a new segment.

bucket
required

The bucket (client) name

string
Example
example
name
string
description
string
segment_type
string
default: dynamic
Allowed values: dynamic static hybrid auxiliary
view_context
string
Allowed values: comments crm documents events forms giving membership minimal_membership_directory reservations teams vehicles
parent_segment

URIs are unique identifiers for resources in the system, they are structured as follows /bucket/resource_type/uid/

string
Example
/example/person/6305f074683e800f3abe809e/
active
boolean
default: true
rules
Array<object>
object
field
string
operator
string
Allowed values: and_list equals exact greater_than greater_than_or_equals less_than less_than_or_equals near none_of not_equal_to or_list raw starts_with starts_with_case_insensitive
value
One of:
string
uris_include
Array<string>
uris_exclude
Array<string>
resource_type
required
string
Allowed values: achievement booking comment contact duplicates form_response group group_member journal membership message organisation page_document payment person reservation sheep_event vehicle
system_segment
boolean
tags
Array<string>
mailchimp_sync
boolean

If this is a segment of contacts, syncing will create a matching segment in mailchimp

The segment created

object
active
boolean
created

A date in the format YYYY-MM-DDTHH:MM:SS.mmmmmm

string
Example
2023-09-05T11:27:06.437000
description
string
display_value

The human readable value of the record the URI points to

string
last_updated

A date in the format YYYY-MM-DDTHH:MM:SS.mmmmmm

string
Example
2023-09-05T11:27:06.437000
legacy_uid
string
mailchimp_sync
boolean
name
string
parent_segment
string
record_state
string
resource_type

The type of resource, usually the second element in the URI e.g person, organisation, member, payment

string
Example
person
rules
object
segment_type

Dynamic segments are based on a query that is run each time the segment is accessed. Static segments are lists of records. Hybrid segments are a combination of dynamic and static segments. They can support a rule with exclusions or inclusions. Auxiliary segments are nodes with no data of their own. They are used to group segments into a navigable hierarchy.

string
Allowed values: dynamic static hybrid auxiliary
system_segment

System segments are created by the system and cannot be edited or deleted.

boolean
tags
Array<string>
uid

Usually the final element in the URI, an alphanumeric unique identifier

string
Example
6305f074683e800f3abe809e
uri

URIs are unique identifiers for resources in the system, they are structured as follows /bucket/resource_type/uid/

string
Example
/example/person/6305f074683e800f3abe809e/
uris_exclude
Array<string>
uris_include
Array<string>
user_interface
object
can_create_segment
boolean
can_delete_segment
boolean
can_edit_segment
boolean
can_restore_segment
boolean
policy_name
string
view_context
Array<string>

A standard error message

object
description

A human readable description of the error

string
error

A concise error message

string
type

A machine readable error type

string

Authentication error