TanqoryDocs

segment

  • Query
  • Customers and B2B

Returns one customer segment by ID, or null when it does not exist.

Arguments

ArgumentTypeRequiredDefault
idID!Required

Returns

Segment A saved group of customers defined by a segment query, with its name and when it was created and last edited.

FieldTypeDescription
creationDateDateTime!
idID!
lastEditDateDateTime!
nameString!
queryString!
tanqoryExtAuthorTanqoryExtSegmentAuthor

Who created the segment: Tanqory for the built-in segments every store starts with, else the staff member or app that called segmentCreate (its name at that time). Null for a segment whose creator was not recorded.

Example request

A starting point: required arguments as variables and a few fields of the result. Replace the placeholders.

Set STORE_ID and TANQORY_ACCESS_TOKEN in your environment first (Make your first API call).

curl
curl -X POST "https://api.tanqory.com/admin/2026-10/stores/$STORE_ID/graphql" \
  -H "Authorization: Bearer $TANQORY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data '{"query":"query Segment($id: ID!) {\n  segment(id: $id) {\n    creationDate\n    id\n    lastEditDate\n    name\n    query\n  }\n}","variables":{"id":"gid://tanqory/Type/id"}}'

Built from commit c0b3fb3fdef7 · API version 2026-10