ValeronDocs

Analytics

Query analytics

POST/v1/analytics/query

Requires the scope analytics:read

Metric values for a period, by member, team or not grouped. Each value comes with its sample size; below a metric's minimum sample it is null with the reason not_enough_data.

#Request body

application/json
compare_previousboolean
Default: false
filtersobjectrequired
The days a query covers: a period, or a custom range from to to (both dates included, at most 731 days).
Show child attributesHide child attributes
fromstring (date) or null
membersstring[]
Items: 0 to 200
ownerstring or null
periodstring or null
Allowed values: "7d" "30d" "90d" "365d" "all"
positionsstring[]
Items: 0 to 50
teamsstring[]
Items: 0 to 50
tostring (date) or null
group_bystring or null
Allowed values: "member" "position" "team" "source" "day" "week" "month" "stage" "category"
metricsstring[]required
Items: 1 to 50

#Responses

200Successful Response
Show response fieldsHide response fields
dataobject[]required
Show child attributesHide child attributes
groupobject or nullrequired
Show child attributesHide child attributes
keystringrequired
labelstringrequired
metricsobject (values: object)required
Show child attributesHide child attributes
previousobject or nullrequired
Show child attributesHide child attributes
reasonstring or nullrequired
Allowed values: "not_enough_data"
sample_sizeintegerrequired
unknown_countintegerrequired
valueinteger | number | object[] or nullrequired
reasonstring or nullrequired
Allowed values: "not_enough_data"
sample_sizeintegerrequired
unknown_countintegerrequired
valueinteger | number | object[] or nullrequired
group_bystring or nullrequired
metricsobject[]required
Show child attributesHide child attributes
descriptionstringrequired
keystringrequired
labelstringrequired
unitstringrequired
ownerstringrequired
periodobjectrequired
Show child attributesHide child attributes
ends_onstring (date)required
labelstringrequired
starts_onstring (date) or nullrequired
time_zonestringrequired
valuestringrequired
previous_periodobject or nullrequired
Show child attributesHide child attributes
ends_onstring (date)required
labelstringrequired
starts_onstring (date) or nullrequired
time_zonestringrequired
valuestringrequired

#Errors

Errors use the standard error shape.

StatusMeaning
400The request is not valid.
401Not signed in, or the credentials are not valid.
402The balance is too low.
403Not allowed to do this.
404Not found.
409Conflicts with the current state.
413The request body is too large.
415The content type is not supported.
422A value in the request is not valid.
429Too many requests. Wait for Retry-After seconds.
500Something went wrong on our side.
502A service Valeron depends on refused the request.
503A service Valeron depends on is unavailable.