publ betaReference (MCP guide)
Open publ console

segments_get

[Migration map](../reference/tool-name-migration.md).

# segments_get

Read one segment page or a selected segment's stored condition trees before composing a change.

## Access and identity

Requires OWNER or DELEGATEE with MANAGE_SEGMENT on the selected channel; promotion/discount permissions do not substitute for this standalone screen. Hosted source scope is channel-only. channelCode is the exact discovered code, 1–512 characters, excluding dot/dot-dot, slash, backslash and control characters. It is not a URL or numeric channel ID. All input objects are strict.

An input distinctId is an observed opaque identifier matching `[A-Za-z0-9_-]{1,128}`, excluding create, next, add and bulk-delete. It is not a numeric row id or title. Source list strings alone do not waive this input validation.

| Input | Contract |
| --- | --- |
| channelCode | Required selected channel code. |
| view | Optional discriminated object; defaults to list/page 1/limit 15. |
| view.kind | list or detail. |
| view.page | List only; positive safe integer, default 1. |
| view.limit | List only; 15, 30, 50 or 100, default 15. |
| view.search | List only; optional string of at most 500 characters, not trimmed. |
| view.distinctId | Required only for detail; observed segment identity. |

```json
{"channelCode":"selected-channel-code","view":{"kind":"list","page":1,"limit":15}}
```

```json
{"channelCode":"selected-channel-code","view":{"kind":"detail","distinctId":"observed-segment"}}
```

## Observation and result

Success is SEGMENTS_SCREEN with status:success, screenId:channel.segments, environment, channel, contentTrust:untrusted_user_content and writesPerformed:false. verification.confirmed:true denotes the bounded observation, with atomicSnapshot:false and memberEligibilityVerified:false. Outside demo, consoleUrl uses the single `/channels/{channelCode}/segments` list destination; current list results retain page, limit and optional search in its query. Rename, conditions and delete are source modals; no target-specific URL is invented.

List reads the projected page twice and compares row order/content and pagination. pagination has currentPage, limit and totalEntries. The requested page/limit and expected row count must agree, numeric ids and distinctIds must each be unique, and a present channelId must match. coverage.completeInventory is always false, even on the last page; nextPage is the next page number or null. creationRevision hashes selected channel/operator/connection context for create, not the list contents or available capacity.

Each list row has positive safe-integer id, distinctId, title, optional/null description, isPreset, insertedAt, updatedAt and evaluationType FINALIZED/MUTABLE; channelId is optional. Detail reads the complete record twice, rejects drift/foreign identity, then returns segment, revision and editable:!isPreset. revision includes full internal detail and context, including unknown stored business fields and timestamps. Readonly projection removes unknown fields from the public trees without dropping them from revision/preservation checks.

Detail adds inclusionTree and optional/null exclusionTree. Trees have four fixed depths: depth 1 STRUCTURE/AND → depth 2 STRUCTURE/AND → depth 3 STRUCTURE/OR → depth 4 CONDITION_ITEM/N/A with empty children. Source bounds are 20 depth-2 groups, 20 depth-3 groups per parent, 50 leaves per group and at most 500 conditions per tree. A leaf may omit conditionItem. Known condition fields include classificationCode, targetEntityIds/metas, value (string/null/absent), itemName, contextualFieldTemplate, selectedOptionName/Description, optional releaseStatus, valueType and evaluationType. Metadata projects id/title and optional description/isDeleted. Source target ID/meta arrays are bounded to 500 each. Standalone segment description preserves string, null or absence through projection, revision and journal comparisons. This does not broaden the connected-segment contracts used by other screens. These read bounds differ from the smaller [writer input bounds](publ_segment_preview.md#condition-input).

Selected channel, operator, permission and credential continuity are rechecked before return. Malformed/missing detail, duplicate identities, inconsistent pagination, drift and changed context fail; a missing segment is not a successful empty detail. Presets can be read but cannot be updated/deleted. No count, entity-resolution POST, business mutation or workflow job occurs. This is neither a member export nor evidence that a member qualifies for a benefit.

## Current list navigation

Current results include parsed view. List navigation preserves page, limit and optional search from that view and validates the matching returned pagination and row count. Detail validates the selected distinctId and opens the bare parent list; no modal deep link is invented. Missing/mismatched view or a changed query cannot produce a destination. SEGMENT_PAGE_OUT_OF_RANGE rejects pages past the observed last page without choosing a replacement; explicitly request page1 again. An empty first page remains valid.

Current observations use the [bounded response and recovery rules](../guides/segments.md#oversized-responses-and-recovery).
An oversized response is not a successful empty result. If a write was already
sent, retain its original task and reconcile; the failed read does not authorize
repeating the change.

## Inputs

| Field | Required here | Contract |
| --- | --- | --- |
| `view` | No | one of: `list`, `detail` (by `kind`); default `{"kind":"list","page":1,"limit":15}` |
| `view.page` | No | When `view.kind` is `list`: integer; greater than 0; default `1` |
| `view.limit` | No | When `view.kind` is `list`: `15` or `30` or `50` or `100`; default `15` |
| `view.search` | No | When `view.kind` is `list`: string; max length 500 |
| `view.distinctId` | Yes | When `view.kind` is `detail`: string; pattern `^[A-Za-z0-9_-]{1,128}$` |