# Segment

object type

A Segment: a merchant-authored CONSUMER grouping for marketing. segmentType is IMMUTABLE at birth — static (explicit membership: batched adds/removes of ≤48 consumers per call, the one-transaction law; the pair key dedupes structurally) or dynamic (membership DERIVED from the stored predicate — the member ops refuse; edit the predicate/exclusions and call refreshSegment to re-materialize; evaluatedAt shows the staleness honestly, refreshProblem words a queued refresh that could not complete, and a scheduled sweep re-refreshes stale ACTIVE dynamics ~daily). memberCount meters live membership (bounded ≤100000 — the add/refresh refuses past it naming the figure). MARKETING-ONLY-OVER-CONSENTED is the CONSUMING lane's law when campaigns/exports arrive — the definition stores membership only. NOT searchable (a membership register); inactive = staging (membership edits stay legal while building).

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (SE-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `Segment` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: active \| inactive \| doomed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent org group; for a Segment parentId === rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `segmentType` | [SegmentType](/types/SegmentType/) `SegmentType!` | static \| dynamic — IMMUTABLE at birth (a different kind is a NEW segment). |
| `memberCount` | [Int](/types/#scalars) | The live membership meter (the counter twin of the member rows); absent = never added. |
| `predicate` | [SegmentPredicate](/types/SegmentPredicate/) | The dynamic rule (dynamic-only; AND across supplied axes, OR within one) — membership re-materializes at refreshSegment. |
| `excludedConsumerIds` | [ID](/types/#scalars) `[ID!]` | Manual exclusions (dynamic-only; at most 256, unique, write-time-validated Consumer refs) — subtracted AFTER matching at every refresh. |
| `evaluatedAt` | [String](/types/#scalars) | The last refresh instant (dynamic-only; absent = never refreshed — honest staleness). |
| `refreshProblem` | [String](/types/#scalars) | The async lane’s honest-failure word: why the last QUEUED refresh could not complete (figures named); cleared by any successful refresh; absent = clean. |

## Used by

- [createSegment](/reference/segment/createSegment/)
- [deactivateSegment](/reference/segment/deactivateSegment/)
- [doomSegment](/reference/segment/doomSegment/)
- [reactivateSegment](/reference/segment/reactivateSegment/)
- [segment](/reference/segment/segment/)
- [updateSegment](/reference/segment/updateSegment/)
