Skip to content
gist.link ↗

segments

Query CRM API — POST https://crm.api.gist.link/graphql

Saved segments (dynamic criteria-defined or static lists). Lazily provisions the org’s default Customers segment.

crm:query:segments

The calling IAM key must hold this permission (or a wildcard that covers it: crm:query:* or crm:*) and the access token must have been minted with audience=crm. See Permissions.

type Query {
segments(filter: SegmentFilter, sort: SortInput, first: Int, after: String): SegmentConnection!
}
Argument Type Required Description
filter SegmentFilter No —
sort SortInput No —
first Int No —
after String No —

SegmentConnection! — see the CRM types reference.

Terminal window
curl https://crm.api.gist.link/graphql \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'JSON'
{
"query": "query Segments($filter: SegmentFilter, $sort: SortInput, $first: Int, $after: String) { segments(filter: $filter, sort: $sort, first: $first, after: $after) { totalCount edges { cursor node { uuid name description targetType mode isDefault criteria ownerUserUuid } } } }",
"variables": {
"filter": {
"search": "example",
"targetType": "example",
"mode": "example"
},
"sort": {
"field": "example",
"direction": "ASC"
},
"first": 10,
"after": "cursor"
}
}
JSON