Get query history

Prev Next
Get
/query/history

Get list of upcoming, running and performed queries from given time range

Security
HTTP
Type bearer

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

Query parameters
json
Required

JSON-encoded query history parameters

object
api_key
string

API key when not using an authorization header

Max length255
Pattern^[A-Za-z0-9_-]+$
ds_ids

Target data source IDs (case-insensitive)

OneOf
string
string
Max length50
Pattern^[A-Za-z0-9_-]+$
array
array
string
Max length50
Pattern^[A-Za-z0-9_-]+$
status_codes

Target query status codes (case-insensitive)

OneOf
string
string
Valid values[ "SCHEDULED", "QUEUED", "RUNNING", "SUCCESS", "FAILURE", "STOPPED" ]
Max length20
array
array
string
Valid values[ "SCHEDULED", "QUEUED", "RUNNING", "SUCCESS", "FAILURE", "STOPPED" ]
Max length20
since
string

Return queries requested after given ISO 8601 datetime, date, or relative time (default 24 hours ago, max 90 days)

Max length100
Pattern^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?|\d{4}-\d{2}-\d{2}|[a-z_]+)$
until
string

Return queries requested before given ISO 8601 datetime, date, or relative time (defaults to current time)

Max length100
Pattern^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z?|\d{4}-\d{2}-\d{2}|[a-z_]+)$
offset
integer (int32)

Pagination offset

Minimum0
Maximum1000000
Default0
limit
integer (int32)

Maximum number of queries to return

Minimum1
Maximum1000
Default100
Example{ "ds_ids": [ "GAWA" ], "since": "2024-01-01" }
Responses
200

Query history 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_-]+$
filter
object
since
string (date-time)

Used start time

Max length30
until
string (date-time)

Used end time

Max length30
paginate
object
offset
integer (int32)

Used pagination offset

Minimum0
Maximum1000000
limit
integer (int32)

Used pagination limit

Minimum1
Maximum1000
total
integer (int64)

Total number of queries found within time range

Minimum0
Maximum100000000
data
Array of object
Max items1000
object
@type
string

Object type

Valid values[ "query_history" ]
Max length50
schedule_time
string (date-time)

When query was requested

Max length30
schedule_id
string

Query schedule ID

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

Current query status code

Max length20
app_id
string

Supermetrics product used to perform the query

Valid values[ "API" ]
Max length10
ds_id
string

Query data source ID

Max length50
Pattern^[A-Za-z0-9_-]+$
total_rows
integer (int64) | null

Number of result rows (only for SUCCESS and FAILURE status)

Minimum0
Maximum100000000
run_seconds
number (float) | null

Query execution time in seconds (only for SUCCESS and FAILURE status)

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