Skip to main content
GET
/
api
/
v1
/
usage
/
{customerId}
/
history
/
{featureId}
JavaScript
import Stigg from '@stigg/typescript';

const client = new Stigg({
  apiKey: process.env['STIGG_API_KEY'], // This is the default and can be omitted
});

const response = await client.v1.usage.history('featureId', {
  customerId: 'customerId',
  startDate: '2019-12-27T18:11:19.117Z',
});

console.log(response.data);
{
  "data": {
    "series": [
      {
        "tags": [
          {
            "key": "<string>",
            "value": "<string>"
          }
        ],
        "points": [
          {
            "timestamp": "2023-11-07T05:31:56Z",
            "value": 123,
            "isResetPoint": true
          }
        ]
      }
    ],
    "markers": [
      {
        "type": "PERIODIC_RESET",
        "timestamp": "2023-11-07T05:31:56Z"
      }
    ]
  }
}

Authorizations

X-API-KEY
string
header
required

Server API Key

Path Parameters

customerId
string
required

Customer id

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.@-]*$
featureId
string
required

Feature id

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$

Query Parameters

resourceId
string | null

Resource id

Required string length: 1 - 255
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$
startDate
string<date-time>
required

The start date of the range

endDate
string<date-time>

The end date of the range

groupBy
string
includeInactiveSubscriptions
boolean

When true, includes usage data from the most recent cancelled or expired subscription

Response

Usage history data points for the specified period.

Response object

data
UsageHistory · object
required

Historical usage time series