Skip to main content
QUERY
segmentByIds(ids: [ID!]!): [Segment!]!

Arguments

ids
[ID!]!
required

Global ids of the segments (Segment.id).

Returns

cardDefinition

Card definition whose cards the segment picks.

cardDefinitionId
ID!

Global id of the card definition whose cards the segment picks (CardDefinition.id), taken from the segment definition.

colorHex
String

Color of the segment (e.g. #ff8800), copied from the segment definition when the segment was created.

createdAt

When the segment was created (UTC).

createdByUser

Id of the user or application that created the segment.

description
String

Free-text note about the segment.

Where the segment is assigned: one item per endpoint and content path.

Arguments
after
String

Returns the elements in the list that come after the specified cursor.

before
String

Returns the elements in the list that come before the specified cursor.

first
Int

Returns the first n elements from the list.

last
Int

Returns the last n elements from the list.

Endpoints the segment is assigned to.

Arguments
after
String

Returns the elements in the list that come after the specified cursor.

before
String

Returns the elements in the list that come before the specified cursor.

first
Int

Returns the first n elements from the list.

last
Int

Returns the last n elements from the list.

endTime

When the segment is archived, on the hour (UTC). Null = never archived on a schedule.

entriesCount

Entries matching the segment's search criteria in its language, whatever its status. 0 for a segment without search criteria.

etag

Version tag for optimistic concurrency. Pass back the value you last read when you change the item.

id
ID!

Global id of the segment: base64 of Segment:<segment id>:<segment definition id>, both raw ids, because a segment id is unique only within its segment definition. segmentById, segmentByIds and the segment mutations take it. Criteria use the raw ids (SegmentsCriteriaInput.include and segmentDefinitionId).

image
String

Image key, lowercase letters a-z only. Null when not set.

isDeleted
Boolean!

True if the segment is archived, by deleteSegment or because its endTime passed. segments and SegmentDefinition.segments return archived segments too. restoreSegment restores it.

isUpdating
Boolean

True while status is INITIALIZING.

language
String!

Language code the criteria use for localized card properties (e.g. en).

lastModified

When the segment last changed (UTC).

lastModifiedByUser

Id of the user or application that last changed the segment.

name
String!

Name of the segment.

Values of the segment definition's custom segment properties. Each item is {key, value}: key is a SegmentPropertyDefinition.id. Can't be set through this API.

Changes to the segment's endpoint assignments that are queued and not applied yet.

Arguments
after
String

Returns the elements in the list that come after the specified cursor.

before
String

Returns the elements in the list that come before the specified cursor.

first
Int

Returns the first n elements from the list.

last
Int

Returns the last n elements from the list.

searchCriteria

Criteria that pick the segment's cards, as a JSON list of objects; a card must match every item. Each item has an operator and its keys, with card property ids of the segment's card definition: equals {propertyId, values, invert} matches any of the values; equalsAll {propertyId, values, invert} needs every value (list card properties); range {propertyId, from, to, invert} is inclusive; hasValue {propertyId, invert}; wildcard {propertyId, value, invert} takes * and ?, case-sensitive; ids {include, exclude} takes card ids; relations {relationDefinitionId, invert} takes a raw relation definition id; anyOf {criteria} matches if any nested item matches. A FIXED segment holds exactly one ids item. Example: [{"operator":"equals","propertyId":"brand","values":["Acme"],"invert":false},{"operator":"range","propertyId":"price","from":10,"to":50,"invert":false}].

searchCriteriaPropertyIds
[String!]!

Card property ids the criteria use, anyOf children included. @existingRelations stands for any relations criterion.

segmentDefinition

Segment definition the segment belongs to.

segmentDefinitionId
ID!

Global id of the segment definition the segment belongs to (SegmentDefinition.id).

startTime

When the segment becomes active, on the hour (UTC). Null = active as soon as it's created.

Lifecycle state of the segment. See SegmentStatus.

tags
[String!]!

Labels for grouping and filtering segments. Alphanumeric, no duplicates.

How the segment picks its cards. See SegmentType.

Query
Variables
Response