Segments
List Segments
List saved segments and their subscriber counts
GET
/
api
/
v1
/
segments
List Segments
curl --request GET \
--url https://api.sequenzy.com/api/v1/segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/segments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequenzy.com/api/v1/segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"segments": [
{
"id": "seg_active_buyers",
"name": "Active buyers",
"filters": [
{
"id": "filter-1",
"field": "tag",
"operator": "contains",
"value": "customer"
}
],
"filterJoinOperator": "and",
"format": "v1",
"createdAt": "2026-04-21T10:00:00.000Z",
"subscriberCount": 1200,
"activeSubscriberCount": 1180
}
]
}
{
"success": false,
"error": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"code": "SEGMENT_REFERENCE_DEPTH_EXCEEDED",
"title": "Segment references nested too deeply",
"description": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"howToFix": "Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"docsUrl": "https://docs.sequenzy.com/api-reference/segments/count",
"details": {
"limit": "depth",
"segmentId": "seg_r",
"referenceChain": [
"seg_b",
"seg_c",
"seg_d",
"seg_e",
"seg_f",
"seg_g",
"seg_h",
"seg_i",
"seg_j",
"seg_k",
"seg_l",
"seg_m",
"seg_n",
"seg_o",
"seg_p",
"seg_q"
],
"maxDepth": 16,
"maxReferences": 1000
}
}
{
"success": false,
"error": "Unauthorized"
}
List the saved segments in your company.
Counts are recalculated from each segment’s saved filters on every request.
subscriberCount includes matching contacts of every status;
activeSubscriberCount includes only active contacts and matches
Get Segment Count when the underlying data
is unchanged. Custom-attribute updates sync asynchronously, so counts can
take roughly 30–35 seconds or longer to reflect an import, even after its
status becomes completed.
A segment can use the segment filter to include or exclude another saved
segment, and that segment can reference others in turn. Counting follows up
to 16 levels of these references and up to 1,000 references in total, counting
a segment again each time it is referenced. Nested filter groups inside a
segment do not count toward either limit. Past a limit, the request returns
400 with code SEGMENT_REFERENCE_DEPTH_EXCEEDED or
SEGMENT_REFERENCE_COUNT_EXCEEDED. details names the segment that
exceeded the limit and the chain of segment IDs followed to reach it.
Retrying does not help. For too-deep chains, copy the conditions of an
inner segment into its parent. For too many references, reference fewer
segments or copy the conditions of shared segments into the segments that
use them.
Request
curl "https://api.sequenzy.com/api/v1/segments" \
-H "Authorization: Bearer YOUR_API_KEY"
Responses
{
"success": true,
"segments": [
{
"id": "seg_active_buyers",
"name": "Active buyers",
"filters": [
{
"id": "filter-1",
"field": "tag",
"operator": "contains",
"value": "customer"
}
],
"filterJoinOperator": "and",
"format": "v1",
"createdAt": "2026-04-21T10:00:00.000Z",
"subscriberCount": 1200,
"activeSubscriberCount": 1180
}
]
}
{
"success": false,
"error": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"code": "SEGMENT_REFERENCE_DEPTH_EXCEEDED",
"title": "Segment references nested too deeply",
"description": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"howToFix": "Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"docsUrl": "https://docs.sequenzy.com/api-reference/segments/count",
"details": {
"limit": "depth",
"segmentId": "seg_r",
"referenceChain": [
"seg_b",
"seg_c",
"seg_d",
"seg_e",
"seg_f",
"seg_g",
"seg_h",
"seg_i",
"seg_j",
"seg_k",
"seg_l",
"seg_m",
"seg_n",
"seg_o",
"seg_p",
"seg_q"
],
"maxDepth": 16,
"maxReferences": 1000
}
}
{
"success": false,
"error": "Unauthorized"
}
⌘I
List Segments
curl --request GET \
--url https://api.sequenzy.com/api/v1/segments \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sequenzy.com/api/v1/segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sequenzy.com/api/v1/segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sequenzy.com/api/v1/segments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sequenzy.com/api/v1/segments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sequenzy.com/api/v1/segments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sequenzy.com/api/v1/segments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"segments": [
{
"id": "seg_active_buyers",
"name": "Active buyers",
"filters": [
{
"id": "filter-1",
"field": "tag",
"operator": "contains",
"value": "customer"
}
],
"filterJoinOperator": "and",
"format": "v1",
"createdAt": "2026-04-21T10:00:00.000Z",
"subscriberCount": 1200,
"activeSubscriberCount": 1180
}
]
}
{
"success": false,
"error": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"code": "SEGMENT_REFERENCE_DEPTH_EXCEEDED",
"title": "Segment references nested too deeply",
"description": "Segment references are nested too deeply. A segment filter can reference other segments up to 16 levels deep, and the reference to segment seg_r would be level 17 (chain: seg_b > seg_c > ... > seg_q > seg_r). Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"howToFix": "Retrying does not help. Copy the conditions of an inner segment into its parent instead of referencing it to reduce the nesting.",
"docsUrl": "https://docs.sequenzy.com/api-reference/segments/count",
"details": {
"limit": "depth",
"segmentId": "seg_r",
"referenceChain": [
"seg_b",
"seg_c",
"seg_d",
"seg_e",
"seg_f",
"seg_g",
"seg_h",
"seg_i",
"seg_j",
"seg_k",
"seg_l",
"seg_m",
"seg_n",
"seg_o",
"seg_p",
"seg_q"
],
"maxDepth": 16,
"maxReferences": 1000
}
}
{
"success": false,
"error": "Unauthorized"
}