Skip to main content

Get Turn Usage by User

This endpoint retrieves a paginated list of TURN server usage statistics for users, indicating the data consumption (in gigabytes) by each user within the current billing period.


GET
    https://<appname>.metered.live/api/v2/turn/current_usage_by_user

<appname> - Replace this with the name of your app.

Request

GET /api/v2/turn/current_usage_by_user

Query Parameters

ParameterDescriptionData Type
secretKeyThe secret key for application accessString
pageThe page number for paginationNumber

Responses

Success Response

A JSON object containing a paginated list of users with their usage details:

FieldDescriptionData TypeNested Fields
dataList of users with usage detailsArraylabel, username, usageInGB
has_moreIndicates if there are more recordsBoolean

Nested Fields for data:

FieldDescriptionData Type
labelThe label associated with the userString
usernameThe username of the userString
usageInGBThe total data used by the user in GBNumber

HTTP Status: 200 OK

Body:

Error Responses

  • Invalid Secret Key or Not Subscribed to TURN Server Plan:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "Invalid request. Not subscribed to any turn server plan"
    }
  • API Not Available Under Free Plan:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "api not available under free plan"
    }
  • Internal Error:

    HTTP Status: 500 Internal Server Error

    Body:

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