Usage reports
Generate usage reports for your customer for the specified time period.
GET https://appapi.heymantle.com/v1/usage_events/:id/report
The Usage Report object
A structured report of the usage events for a customer’s account for the specified time period.
Header parameters
X-Mantle-App-Id
stringThe App Id when you create an API key in your Mantle dashboard.
X-Mantle-Customer-Api-Token
stringThe API token you receive from your POST request to the /identify endpoint.
Attributes
startDate
dateThe start date of the report.
endDate
dateThe end date of the report.
period
enumThe period of the report. One of daily, weekly, or monthly.
data
[object]An array of usage report data, with date and value parameters, where value is the result of the usage metric.
{
"usageReport": {
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-12-31T23:59:59Z",
"period": "monthly",
"data": [
{
"date": "2024-01-01T00:00:00Z",
"value": 5612.10
},
{
"date": "2024-02-01T00:00:00Z",
"value": 7227.10
}
]
}
}
GET /v1/usage_events/:id/report
Generate a usage report for your customer’s account for the specified time period.
Header parameters
X-Mantle-App-Id
stringThe App Id when you create an API key in your Mantle dashboard.
X-Mantle-Customer-Api-Token
stringThe API token you receive from your POST request to the /identify endpoint.
Request parameters
:id
stringThe unique identifier for the Usage Metric.
period
enumThe period of the report. One of daily, weekly, or monthly.
curl --request GET \
--url https://appapi.heymantle.com/v1/usage_events/123/report \
--header 'X-Mantle-App-Id: string' \
--header 'X-Mantle-Customer-Api-Token: string' \
--header 'Content-Type: application/json' \
--data '
{
"period": "monthly",
}
'
Returns a Usage Report for the specified time period.