Groups of members who meet conditions you set, and each member's progress towards them.
A segment is a group of members who meet conditions you set, such as a minimum spend, a number of orders or a Shopify tag. Membership tiers are built on segments. You create and edit segments in the Toki app; these operations read them, show how close a member is to each one, and trigger a recheck.
segmentCreateCreates a segment and queues membership reevaluation.segmentUpdateUpdates an owned segment and queues membership reevaluation, including its Shopify tag behavior.segmentDeleteDeletes an owned segment and starts its existing background membership cleanup.segmentsLists your segments, most recently updated first.segmentReturns a segment by ID, or null if there is none.segmentMembersCountReturns how many members of the current store are in a segment.userSegmentProgressShows a member's progress towards your segments, a page of segments at a time in the order of segments.segmentReevaluateQueues a background recheck of one of your segments.segmentsReevaluateAllRechecks all your segments in the background.userSegmentsLists who is in your segments, most recently added first, for members of the current store.userSegmentDetailsReturns the segments a member is in, most recently entered first, with each segment's top-level conditions and whether the member meets them now.Creates a segment and queues membership reevaluation. Returns before the background recheck completes.
configurationTokiSegmentCreateConfigurationInput!RequiredSaved segment.
idString!ID of the saved segment.
Updates an owned segment and queues membership reevaluation, including its Shopify tag behavior.
idID!RequiredconfigurationTokiSegmentCreateConfigurationInput!RequiredSaved segment.
idString!ID of the saved segment.
Deletes an owned segment and starts its existing background membership cleanup.
idID!Requiredtrue when the change was made. Anything that stops it comes back as an error.
Lists your segments, most recently updated first.
queryStringText in the segment's name, Shopify tags (alias) or ID.
reverseBooleanReverse the sort order.
ids[String!]Restrict results to these segment IDs. An empty list returns none.
A page of TokiSegment in nodes, with pageInfo for the next page. Each item:
A group of members who meet conditions you set, such as a minimum spend or a Shopify tag.
idID!nameString!aliasString!Shopify customer tags, separated by commas, that Toki adds to members of the segment and removes when they leave, unless another of their segments uses the same tag. If none are set, Toki uses one made from the segment's name, such as gold_members for Gold Members.
memberLimitFloatThe member limit, or null if the segment has none.
resetPeriodFloatNot used to decide who is in the segment. Time windows are set on each condition's date_settings.
updatedAtString!trackingSettingsTokiSegmentTrackingSettingstagsOnExit lists Shopify customer tags that Toki adds to a member when they leave the segment and removes when they enter it.
reminderSettingsTokiSegmentReminderSettingsExit reminders. When enabled, Toki checks the segment once a day and sends a Toki Segment Reminder event for each member who would no longer qualify daysBefore days from now, at most once every daysInterval days per member. The event can trigger a workflow or campaign.
unlockConditionTokiSegmentUnlockCondition!The conditions a member must meet to be in the segment: all of conditions when operator is AND, any one when it's OR. A condition of type boolean is a nested group with its own operator. Toki rechecks a member when something a condition looks at changes, such as their balance, orders or activity completions. Outside nested groups, it also rechecks Shopify tag and Klaviyo conditions every hour, and most conditions with a rolling time window, such as in-the-last, once a day.
related[TokiSegmentMembership!]!Membership tiers and paid memberships built on this segment.
membersTokiUserSegmentConnection!Members of the current store who are in the segment, most recently added first.
Returns a segment by ID, or null if there is none.
idID!RequiredA group of members who meet conditions you set, such as a minimum spend or a Shopify tag.
idID!nameString!aliasString!Shopify customer tags, separated by commas, that Toki adds to members of the segment and removes when they leave, unless another of their segments uses the same tag. If none are set, Toki uses one made from the segment's name, such as gold_members for Gold Members.
memberLimitFloatThe member limit, or null if the segment has none.
resetPeriodFloatNot used to decide who is in the segment. Time windows are set on each condition's date_settings.
updatedAtString!trackingSettingsTokiSegmentTrackingSettingstagsOnExit lists Shopify customer tags that Toki adds to a member when they leave the segment and removes when they enter it.
reminderSettingsTokiSegmentReminderSettingsExit reminders. When enabled, Toki checks the segment once a day and sends a Toki Segment Reminder event for each member who would no longer qualify daysBefore days from now, at most once every daysInterval days per member. The event can trigger a workflow or campaign.
unlockConditionTokiSegmentUnlockCondition!The conditions a member must meet to be in the segment: all of conditions when operator is AND, any one when it's OR. A condition of type boolean is a nested group with its own operator. Toki rechecks a member when something a condition looks at changes, such as their balance, orders or activity completions. Outside nested groups, it also rechecks Shopify tag and Klaviyo conditions every hour, and most conditions with a rolling time window, such as in-the-last, once a day.
related[TokiSegmentMembership!]!Membership tiers and paid memberships built on this segment.
membersTokiUserSegmentConnection!Members of the current store who are in the segment, most recently added first.
Returns how many members of the current store are in a segment.
idID!RequiredShows a member's progress towards your segments, a page of segments at a time in the order of segments. For each segment you get whether the member is in it and their progress on every condition.
queryStringText in the segment's name, Shopify tags (alias) or ID.
reverseBooleanReverse the sort order.
ids[String!]Restrict results to these segment IDs. An empty list returns none.
customerIdID!RequiredThe member's ID (TokiUser.id).
A page of TokiUserSegmentProgressNodes in nodes, with pageInfo for the next page. Each item:
A member's progress towards one segment.
idID!The segment's ID.
nameString!The segment's name.
openedBoolean!Whether the member is in the segment.
labelString!The segment's conditions as text: the unlockProgress labels joined with and or or.
unlockProgress[TokiUserSegmentProgressNodesUnlockProgress!]!Progress on each condition. Conditions in nested groups are listed one by one.
Queues a background recheck of one of your segments. Returns true once queued, before membership changes are complete. Missing, deleted or other merchants' segments return NOT_FOUND. The recheck has the same membership, tag and reward behavior as segmentsReevaluateAll.
The segment to recheck in the background.
idID!RequiredThe ID of your segment to recheck.
true when the change was made. Anything that stops it comes back as an error.
Rechecks all your segments in the background. Toki adds members who now qualify, removes those who no longer do unless Maintain status keeps them in, and updates their Shopify tags. For most segments, these changes don't trigger tier rewards or the TIER_EARNED and TIER_LOST webhooks.
Nothing to set: pass an empty input: {}.
true when the change was made. Anything that stops it comes back as an error.
Lists who is in your segments, most recently added first, for members of the current store. Filter by segmentId for one segment's members, or by userId for one member's segments.
queryStringText in a member's email, name or phone number, or a member ID. You can also filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: created_at (when the member entered the segment), updated_at, segment_id, user_id, email, first_name, last_name, phone_number, name.
reverseBooleanReverse the sort order.
userIdIDOnly items whose userId equals this value.
segmentIdIDOnly items whose segmentId equals this value.
A page of TokiUserSegment in nodes, with pageInfo for the next page. Each item:
A member who is in a segment.
createdAtString!When the member entered the segment.
updatedAtString!userIdID!The member in the segment.
segmentIdID!segmentNameString!tags[String!]!The segment's Shopify tags, from its alias.
userTokiUserThe member in the segment.
Returns the segments a member is in, most recently entered first, with each segment's top-level conditions and whether the member meets them now. For progress on every condition, use userSegmentProgress.
userIdID!RequiredThe member.
The segments a member is in, and which of their conditions the member meets.
withMaintainStatusBoolean!Whether Maintain status is on. When it is, members can stay in a segment after they stop meeting its conditions.
segments[TokiUserSegmentDetailsSegments!]!The member's segments, most recently entered first.