AckdbSegment

A saved Observe Segment - config only (no data snapshot). Owned + per-user shared (#284); soft-deleted via deleted_at.

Properties

idstringrequired

ULID.

namestringrequired
descriptionstring | null
entityKindstringrequired

Home (authoring) grain - the vocabulary the filter/sort/columns are written in. Every segment is also projectable to the other grains at read time via GET /observe/segments/{id}/results?grain=…, so this is where the filter was authored, not the only grain it can render.

"company""contact""person"
sortarray ofrequired
columnsarray ofrequired
isDefaultbooleanrequired

True when this Segment is the default view for its entity_kind (one per kind).

baseSegmentIdstring | nullrequired

DERIVED segment: the base segment this one is built on. When set, entityKind is the OPPOSITE of the base's grain, `filter` is the render-grain filter on top, and GET /results renders the base's filter pivoted into this grain AND this filter - composed at read time, no stored id set. null for a normal (root) segment.

ownerEmailstring | nullrequired

The segment's OWNER (#284) - the creator's JWT email. null = legacy / service-created = grandfathered org-visible + editable. Stamped server-side on create (never accepted from the client) and immutable thereafter; sharing with teammates is per-member via /shares.

accessstring

The CALLER's effective role on this segment (#284). Present on single reads; drives client action gating (owner/edit may save; owner only may delete / manage shares / set default).

"owner""edit""view"
createdAtstring <date-time>required
updatedAtstring <date-time>required

Example

AckdbSegment example
{
  "id": "01J9Z8Q3K2X7M4N5P6R7S8T9V0",
  "name": "Active paying companies",
  "description": "Companies with a paid Stripe invoice",
  "entityKind": "company",
  "filter": {
    "type": "group",
    "op": "and",
    "children": [
      {
        "$ref": "See AckdbObserveFilterGroup"
      }
    ]
  },
  "sort": [
    {
      "field": "event_count",
      "dir": "asc"
    }
  ],
  "columns": [
    {
      "field": "name",
      "frozen": true,
      "width": 200
    }
  ],
  "isDefault": false,
  "baseSegmentId": null,
  "ownerEmail": "rep@acme.com",
  "access": "owner",
  "createdAt": "1970-01-01T00:00:00.000Z",
  "updatedAt": "1970-01-01T00:00:00.000Z"
}