Skip to main content

Get TURN Credentials

You can use this API to fetch all the credentials you have created.


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

<appname> - Replace with the name of your application.

Request

GET /api/v2/turn/credentials

Query Parameters

ParameterDescriptionData Type
secretKeyThe secret key for application authenticationString
allFlag to fetch expired credentials as well, by default expired credentials are not returned. (optional)Boolean
pagePage number for paginated results (optional)Integer
labelFilter the TURN Credentials by label. When a label is specified, it will return only the TURN Credentials that match the label.String

Responses

Success Response

A JSON object containing the credentials, along with pagination details if applicable:

FieldDescriptionData Type
dataArray of TURN credentialsArray
paginationObject with pagination detailsObject

HTTP Status: 200 OK

Body Example:

{
"data": [
{
"username": "example_username",
"password": "example_password",
"apiKey": "example_apiKey",
"expiryInSeconds": 3600,
"label": "example_label",
"expired": false
}
// ... more credentials
],
"pagination": {
"total_records": 100,
"current_page": 1,
"total_pages": 2,
"next_page": 2,
"prev_page": null
}
}

Error Responses

  • Not Subscribed to Any 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"
    }