Docs API reference Usage reports

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-Idstring

The App Id when you create an API key in your Mantle dashboard.

X-Mantle-Customer-Api-Tokenstring

The API token you receive from your POST request to the /identify endpoint.

Attributes

startDatedate

The start date of the report.

endDatedate

The end date of the report.

periodenum

The 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-Idstring

The App Id when you create an API key in your Mantle dashboard.

X-Mantle-Customer-Api-Tokenstring

The API token you receive from your POST request to the /identify endpoint.

Request parameters

:idstring

The unique identifier for the Usage Metric.

periodenum

The 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.