Segment
Stored in the segments collection. createdAt and updatedAt are maintained automatically.
Returned by GET /segment, POST /segment, GET /segment/:id, PUT /segment/:id, GET /segment/execute.
Example
One real Segment as returned by GET /segment, taken from the data array. Recorded from a live response, so the defaults, denormalised snapshots and populated fields are the actual ones:
{
"_id": "6a95738b859eafb47bf22821",
"name": "Enterprise prospects",
"description": "Enterprise-tagged contacts not yet customers.",
"company": "6a9572df859eafb47bf225d7",
"filterType": "AND",
"filters": [],
"cachedCount": 3,
"isActive": true,
"type": "contact",
"createdBy": {
"_id": "6a9572df859eafb47bf225d9",
"name": "Docs Test User",
"email": "test@test.test",
"status": "owner"
},
"updatedBy": {
"_id": "6a9572df859eafb47bf225d9",
"name": "Docs Test User",
"email": "test@test.test",
"status": "owner"
},
"createdAt": "2026-08-31T12:28:59.904Z",
"updatedAt": "2026-08-31T12:28:59.922Z",
"__v": 0,
"lastRefreshed": "2026-08-31T12:28:59.922Z"
}
:::note Trimmed for reading A populated reference is shown by the fields that identify it rather than in full — it arrives as the entire referenced document. Long arrays are cut to the first two entries and marked, long strings are truncated, and any field that could carry a credential is dropped rather than masked. :::
Fields
| Field | Type | Notes |
|---|---|---|
name | string | required |
description | string | |
company | ObjectId -> Company | |
filterType | string | default AND · one of AND, OR |
filters | object[] | default [] |
filters.conditionType | string | default AND · one of AND, OR |
filters.conditions | object[] | default [] |
filters.conditions.fieldId | string | required |
filters.conditions.fieldType | string | |
filters.conditions.dependencySelections | any | default {} |
filters.conditions.operator | string | required · one of is, is not, contains, starts with, has all, has any, does not have, greater than and 8 more |
filters.conditions.operators | string[] | default [] |
filters.conditions.value | any | |
filters.conditions.sourceFieldId | string | |
filters.conditions.nestedPath | string[] | default [] |
filters.conditions.isNestedCustomField | boolean | |
filters.conditions.parentCollectionType | string | |
filters.conditions.pathLabel | string | |
filters.conditions.type | string | |
filters.conditions.panel | string | default contact · one of contact, lead, productService |
cachedCount | number | default 0 |
lastRefreshed | date | |
isActive | boolean | default true |
type | string | default contact · one of contact, lead, product, service |
createdBy | ObjectId -> Member | |
updatedBy | ObjectId -> Member | |
_id | ObjectId | |
createdAt | date | set once |
updatedAt | date |