List survey segments
curl --request GET \
--url https://app.gaintrace.com/api/v1/survey-segments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.gaintrace.com/api/v1/survey-segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.gaintrace.com/api/v1/survey-segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "3f6a9c1e-8b2d-4c7a-9e5f-0a1b2c3d4e5f",
"name": "Enterprise decision makers",
"company": {
"logic": "and",
"rules": [
{
"field": "segment",
"operator": "eq",
"value": "enterprise"
}
]
},
"person": {
"logic": "and",
"rules": [
{
"field": "contactRole",
"operator": "is_any_of",
"value": [
"decision_maker",
"executive_sponsor"
]
}
]
},
"createdAt": "2026-10-14T09:00:00.000Z",
"updatedAt": "2026-10-14T09:00:00.000Z"
}
],
"meta": {
"limit": 1,
"offset": 0,
"count": 1
}
}{
"error": {
"code": "unauthorized",
"message": "Missing Authorization header",
"doc_url": "https://docs.gaintrace.com/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Insufficient scope: write:companies required",
"doc_url": "https://docs.gaintrace.com/errors#forbidden"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Can't accept more than 60 requests a minute from one API key. Retry in 23 seconds.",
"doc_url": "https://docs.gaintrace.com/errors#rate_limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "Something went wrong. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#internal_server_error"
}
}{
"error": {
"code": "service_unavailable",
"message": "We had trouble reaching the database. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#service_unavailable"
}
}{
"error": {
"code": "gateway_timeout",
"message": "The request timed out. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#gateway_timeout"
}
}Survey segments
List survey segments
List the workspace’s saved survey segments, by name. Archived segments are left out. The list is not paged: meta.count is the number of segments. Requires a secret server key (gt_live_). Publishable keys (gt_pub_) return 403.
Scope: read:surveys
GET
/
survey-segments
List survey segments
curl --request GET \
--url https://app.gaintrace.com/api/v1/survey-segments \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.gaintrace.com/api/v1/survey-segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.gaintrace.com/api/v1/survey-segments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"id": "3f6a9c1e-8b2d-4c7a-9e5f-0a1b2c3d4e5f",
"name": "Enterprise decision makers",
"company": {
"logic": "and",
"rules": [
{
"field": "segment",
"operator": "eq",
"value": "enterprise"
}
]
},
"person": {
"logic": "and",
"rules": [
{
"field": "contactRole",
"operator": "is_any_of",
"value": [
"decision_maker",
"executive_sponsor"
]
}
]
},
"createdAt": "2026-10-14T09:00:00.000Z",
"updatedAt": "2026-10-14T09:00:00.000Z"
}
],
"meta": {
"limit": 1,
"offset": 0,
"count": 1
}
}{
"error": {
"code": "unauthorized",
"message": "Missing Authorization header",
"doc_url": "https://docs.gaintrace.com/errors#unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Insufficient scope: write:companies required",
"doc_url": "https://docs.gaintrace.com/errors#forbidden"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Can't accept more than 60 requests a minute from one API key. Retry in 23 seconds.",
"doc_url": "https://docs.gaintrace.com/errors#rate_limit_exceeded"
}
}{
"error": {
"code": "internal_server_error",
"message": "Something went wrong. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#internal_server_error"
}
}{
"error": {
"code": "service_unavailable",
"message": "We had trouble reaching the database. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#service_unavailable"
}
}{
"error": {
"code": "gateway_timeout",
"message": "The request timed out. Try again in a moment.",
"doc_url": "https://docs.gaintrace.com/errors#gateway_timeout"
}
}Authorizations
Bearer API key. Secret server keys start with gt_live_; client-safe browser keys start with gt_pub_ (write-only, origin-pinned). Create and scope keys in Settings → API Keys.
Was this page helpful?