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

Headers

X-API-KEY
string
required

API Key

Path Parameters

customerId
string
required

Customer id

Required string length: 1 - 255
featureId
string
required

Feature id

Required string length: 1 - 255

Query Parameters

resourceId
string | null

Resource id

Required string length: 1 - 255
startDate
string<date-time>
required

The start date of the range

endDate
string<date-time>

The end date of the range

groupBy
string

Response

OK

Response object

data
UsageHistory · object
required

Historical usage time series