Usage Statistics

The UsageStatistic resource

Key path


type* (string)

Available values: usage-statistics

id (string)

attributes.breakdown-id (string)

The identifier of a resource by which the usage is broken down

attributes.breakdown-name (string)

The name of a resource by which the usage is broken down (string)

The date when usage has been recorded

attributes.runs-count (integer)

The count of runs finished within the date

attributes.runs-seconds (integer)

The duration of runs in seconds within the date

relationships.account (object)

The account id usage is reported for* (string)

Available values: accounts* (string)

links (object)

List Scalr Usage Statistics

GET /usage-statistics

This endpoint returns billing usage statistics for an account within a period of time.

Required permission: accounts:billing

Query Parameters
  • filter[date] (string) – The date filter. Example: filter[date]=between:2022-01-01T00:00:00Z,2022-02-01T00:00:00Z (Required)

  • filter[account] (string) – The account filter. Example: filter[account]=acc-ttpu7uslju6igv8 (Required)

  • breakdown_by (string) – Breakdown by environment or workspace.

  • total (string) – Summarize usage statistics by the whole period.

Example Request:

GET /usage-statistics?filter%5Bdate%5D=string&filter%5Baccount%5D=string HTTP/1.1
Prefer: profile=preview
Status Codes
  • 200 OK


    Example Respone:

    HTTP/1.1 200 OK
    Content-Type: application/vnd.api+json
    Preference-Applied: profile=preview
        "data": [
                "attributes": {
                    "breakdown-id": null,
                    "breakdown-name": null,
                    "date": "2022-01-06",
                    "runs-count": 4,
                    "runs-seconds": 82
                "id": "0209139b4a4f7068241f79e13e362a2bac0638aefc1fb2ea3caa136d0d47dca1",
                "links": null,
                "relationships": {
                    "account": {
                        "data": {
                            "id": "acc-ttpu7uslju6igv8",
                            "type": "accounts"
                "type": "usage-statistics"
        "included": null,
        "links": {
            "first": "",
            "last": "",
            "next": null,
            "prev": null,
            "self": ""
        "meta": {
            "pagination": {
                "current-page": 1,
                "next-page": null,
                "prev-page": null,
                "total-count": 0,
                "total-pages": 1

  • 403 Forbidden – User unauthorized to perform the action.

  • 404 Not Found – Account or environment not found.

  • 4XX – Client error.

  • 5XX – Server error.

Request Headers
  • Prefer – Specifies the API profile that server should use to handle this request. For the list of supported profiles check out the Scalr documentation. (Required)