query SegmentById($id: ID!) {
segmentById(id: $id) {
cardDefinition {
activationStatus {
status
steps {
__typename
}
}
activePropertySet {
key
properties {
__typename
}
propertyIds
}
allowsEnrichment
cardsCount
createdAt
createdByUser
}
cardDefinitionId
colorHex
createdAt
createdByUser
description
}
}{
"id": "id"
}{
"data": {
"segmentById": {
"cardDefinition": {
"activationStatus": {
"status": "RUNNING",
"steps": [
{
"__typename": "KeyValuePairOfStringAndWorkflowStep"
}
]
},
"activePropertySet": {
"key": "string",
"properties": [
{
"__typename": "CardPropertyDefinition"
}
],
"propertyIds": [
"string"
]
},
"allowsEnrichment": true,
"cardsCount": "value",
"createdAt": "value",
"createdByUser": "value"
},
"cardDefinitionId": "id",
"colorHex": "string",
"createdAt": "value",
"createdByUser": "value",
"description": "string"
}
}
}segmentById
Gets a segment by its global id, archived ones included. Fails with NotFoundError when no segment has it.
segmentById(id: ID!): Segment!Arguments
Global id of the segment (Segment.id).
Returns
Card definition whose cards the segment picks.
Global id of the card definition whose cards the segment picks (CardDefinition.id), taken from the segment definition.
Color of the segment (e.g. #ff8800), copied from the segment definition when the segment was created.
When the segment was created (UTC).
Id of the user or application that created the segment.
Free-text note about the segment.
Where the segment is assigned: one item per endpoint and content path.
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
Returns the last n elements from the list.
Endpoints the segment is assigned to.
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
Returns the last n elements from the list.
When the segment is archived, on the hour (UTC). Null = never archived on a schedule.
Entries matching the segment's search criteria in its language, whatever its status. 0 for a segment without search criteria.
Version tag for optimistic concurrency. Pass back the value you last read when you change the item.
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 key, lowercase letters a-z only. Null when not set.
True if the segment is archived, by deleteSegment or because its endTime passed. segments and SegmentDefinition.segments return archived segments too. restoreSegment restores it.
True while status is INITIALIZING.
Language code the criteria use for localized card properties (e.g. en).
When the segment last changed (UTC).
Id of the user or application that last changed the segment.
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.
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
Returns the last n elements from the list.
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}].
Card property ids the criteria use, anyOf children included. @existingRelations stands for any relations criterion.
Segment definition the segment belongs to.
Global id of the segment definition the segment belongs to (SegmentDefinition.id).
When the segment becomes active, on the hour (UTC). Null = active as soon as it's created.
Lifecycle state of the segment. See SegmentStatus.
Labels for grouping and filtering segments. Alphanumeric, no duplicates.
How the segment picks its cards. See SegmentType.
query SegmentById($id: ID!) {
segmentById(id: $id) {
cardDefinition {
activationStatus {
status
steps {
__typename
}
}
activePropertySet {
key
properties {
__typename
}
propertyIds
}
allowsEnrichment
cardsCount
createdAt
createdByUser
}
cardDefinitionId
colorHex
createdAt
createdByUser
description
}
}{
"id": "id"
}{
"data": {
"segmentById": {
"cardDefinition": {
"activationStatus": {
"status": "RUNNING",
"steps": [
{
"__typename": "KeyValuePairOfStringAndWorkflowStep"
}
]
},
"activePropertySet": {
"key": "string",
"properties": [
{
"__typename": "CardPropertyDefinition"
}
],
"propertyIds": [
"string"
]
},
"allowsEnrichment": true,
"cardsCount": "value",
"createdAt": "value",
"createdByUser": "value"
},
"cardDefinitionId": "id",
"colorHex": "string",
"createdAt": "value",
"createdByUser": "value",
"description": "string"
}
}
}Was this page helpful?