Skip to main content

Get Current Usage By Date

Description

This endpoint retrieves the total bytes used during the current billing cycle grouped by date for a given app and its TURN server addon subscription.


GET
    https://<appname>.metered.live/api/v1/turn/current_usage_by_date?secretKey=<YOUR_SECRET_KEY>

<appname> - replace it the name of your app.

Request

GET /api/v1/turn/current_usage_by_date

Query Parameters

ParameterDescriptionData Type
secretKeyThe secret key for authorizationString

Responses

Success Response

An array of JSON objects containing the following fields:

FieldDescriptionData Type
dateThe date for the usage dataString
usageInGBThe total bytes used during the date in gigabytesNumber

HTTP Status: 200 OK

Body:

[
{
"date": "2022-11-01",
"usageInGB": 1.23
},
{
"date": "2022-11-02",
"usageInGB": 2.34
},
...
]

Error Responses

  • Invalid Secret Key:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "message": "Invalid secret key"
    }
  • Invalid Request / Not Subscribed to Any TURN Server Plan

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "Invalid request. Not subscribed to any turn server plan"
    }
  • Internal error occurred

    HTTP Status: 500 Internal Server Error

    Body:

    {
    "message": "Internal error occurred, contact support and provide the event id: <EVENT_ID>"
    }