Skip to content

List saved reports

GET
/stores/{storeRef}/reports
curl --request GET \
--url https://apibase.ecomweb.app/api/v1/stores/example/reports \
--header 'x-api-key: <x-api-key>'

Returns every report saved in the store, without pagination. Each item carries who saved it and, for the user the API key acts as, last_viewed_at and pinned.

Required scopes: read:analytics

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
data
required

The saved reports.

Array<object>
object
definition
required

The saved definition.

object
dimensions
required

Dimensions to group by.

Array<object>
object
grain

Time grain for a date dimension: day, week, month, quarter or year.

string
Allowed values: day week month quarter year
field
required

Key of a dimension of the report’s dataset.

string
filters
required

Conditions that narrow the rows.

Array<object>
object
operator
required

How the values are compared.

string
Allowed values: is is_not gte lte
field
required

Key of a filter of the report’s dataset.

string
values
required

The values to compare with. is and is_not match any of the values.

Array<string>
date_range
required

The days the report covers.

object
start
required

First day, inclusive, as YYYY-MM-DD in the store’s time zone.

string
end
required

Last day, inclusive, as YYYY-MM-DD in the store’s time zone.

string
sort
required

How the rows are sorted.

Array<object>
object
order
required

Sort direction.

string
Allowed values: asc desc
key
required

Key of a selected measure or dimension.

string
visualization

How the dashboard draws the report. It does not change the rows.

string
Allowed values: table line bar
v
required

Version of the definition format.

number
dataset
required

Key of the dataset the report reads, such as orders.

string
measures
required

Keys of the measures to calculate.

Array<string>
limit
required

Maximum number of rows.

number
created_by
required

Who saved the report, or null when that user no longer exists.

object
name
required

Name of the author.

string
email
required

Email address of the author.

string
last_viewed_at
required

When the user behind the key last viewed the report, as an ISO 8601 timestamp, or null.

string
nullable
pinned
required

Whether that user pinned the report.

boolean
id
required

Saved report ID, as a decimal string.

string
created_by_user_id
required

ID of the user who saved the report, or whose API key saved it.

string
name
required

Report name.

string
created_at
required

When the report was saved, as an ISO 8601 timestamp.

string
updated_at
required

When the report was last changed, as an ISO 8601 timestamp.

string

Example

{
"data": [
{
"definition": {
"dimensions": [
{
"grain": "day"
}
],
"filters": [
{
"operator": "is"
}
],
"sort": [
{
"order": "asc"
}
],
"visualization": "table"
}
}
]
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}