Get segments

Prev Next
Get
/query/segments

Retrieve a list of available data source logins and their segments

Security
HTTP
Type bearer

Bearer token authentication. Include the token in the Authorization header: Authorization: Bearer <your-token>

Query parameters
json
Required

JSON-encoded segment query parameters

object
api_key
string

API key when not using an authorization header

Max length255
Pattern^[A-Za-z0-9_-]+$
ds_id
string Required

Data source ID

Max length50
Pattern^[A-Za-z0-9_-]+$
ds_users

List of data source login usernames to target (case-insensitive)

OneOf
string
string
Max length255
array
array
string
Max length255
cache_minutes
integer (int32)

Maximum allowed age of cache in minutes

Minimum60
Maximum1440
Example{ "ds_id": "GAWA" }
Responses
200

Segments retrieved successfully

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
Expand All
object
meta
object
request_id
string

API request ID

Max length50
Pattern^[A-Za-z0-9_-]+$
query
object
cache_minutes
integer (int32) | null

Requested maximum age of cache in minutes

Minimum60
Maximum1440
data
Array of object
Max items100
object
ds_user
string

Data source login username

Max length255
display_name
string

Display name for login

Max length255
cache_time
string (date-time) | null

ISO 8601 datetime for the last time the login data was fetched and cached

Max length30
segments
Array of object
Max items1000
object
segment_id
string

Segment ID

Max length50
Pattern^[A-Za-z0-9_-]+$
segment_name
string

Segment name

Max length255
400

Bad request - invalid parameters

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object

RFC 9457 Problem Details for HTTP APIs

type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys
401

Unauthorized

Headers
WWW-Authenticate
string
Bearer token required
Max length255
Pattern^Bearer.*
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object

RFC 9457 Problem Details for HTTP APIs

type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys
403

Access forbidden

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object

RFC 9457 Problem Details for HTTP APIs

type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys
422

Unprocessable Entity - validation failed

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object
type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys
429

Too Many Requests

Headers
X-RateLimit-Limit
integer
Request limit per hour
Minimum1
Maximum10000
Example5000
X-RateLimit-Remaining
integer
Remaining requests in current window
Minimum0
Maximum10000
Example4999
Retry-After
integer
Seconds until rate limit resets
Minimum1
Maximum86400
Example3600
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object

RFC 9457 Problem Details for HTTP APIs

type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys
500

Internal server error

Headers
Access-Control-Allow-Origin
string
CORS header
Valid values[ "*" ]
Max length255
Example*
object

RFC 9457 Problem Details for HTTP APIs

type
string (uri)

A URI reference that identifies the problem type

Max length255
Examplehttps://supermetrics.com/problems/unauthorized
title
string

A short, human-readable summary of the problem type

Max length255
Pattern^[A-Za-z0-9\s]+$
ExampleUnauthorized
status
integer (int32)

The HTTP status code

Minimum100
Maximum599
Example401
detail
string

A human-readable explanation specific to this occurrence

Max length1000
Pattern^[A-Za-z0-9\s.,\-]+$
ExampleAuthentication required
instance
string (uri)

A URI reference that identifies the specific occurrence

Max length255
Examplehttps://api.supermetrics.com/v2/api-keys