POST /count/{tenantAlias} returns one number: the count of events that match the body. It
takes the same filters as POST /{tenantAlias} and no pagination. The path is relative to the
base URL https://queryapis.grainql.com/v1/api/query.
Request
{tenantAlias} is the tenant alias that the dashboard shows, not the tenant UUID.
Each object in
filterSet has three required fields:
Read Filters for the operators and property paths.
An empty body
{} counts every event of the tenant.
Example
Response fields
When to use count
A count is one small response. A query for the same events returns every event object, one
page at a time, and each page is one request against the rate limit.
Rules for the client
- Send
afterandbeforeon every request. A date range limits the data that the server scans. - To compute a rate, send one count per number, then divide on the client. For example,
count
error_occurredand count every event, then divide. - Cache a count that a dashboard shows often. Every request counts against the rate limit.
- If the API returns
429, waitRetry-Afterseconds, then retry one time. Read Query API for the rate limits and the error table.