POST
/
query
import { Autumn as autumn } from 'autumn-js'

const response = await autumn.query({
customer_id: 'user_123',
feature_id: 'messages',
range: '30d'
})
{
"list": [
{
"period": 1672531200000,
"messages": 45
},
{
"period": 1672617600000,
"messages": 32
},
{
"period": 1672704000000,
"messages": 18
}
]
}
This endpoint allows you to query usage data for specific features over various time ranges. It returns historical usage information that can be used for analytics, reporting, or displaying usage graphs to customers.
You can query usage for a single feature or multiple features in one request by passing an array of feature IDs.
The response returns a list of objects. Each object includes a period timestamp and one key per requested feature ID with its usage value.

Authorizations

Authorization
string
header
required

Use your Autumn Secret Key as the Bearer token.

Body

application/json

The body is of type object.

Response

200 - application/json

Usage data for the specified features

The response is of type object.