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
Parameter | Description | Data Type |
---|---|---|
secretKey | The secret key for application authentication | String |
all | Flag to fetch expired credentials as well, by default expired credentials are not returned. (optional) | Boolean |
page | Page number for paginated results (optional) | Integer |
label | Filter 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:
Field | Description | Data Type |
---|---|---|
data | Array of TURN credentials | Array |
pagination | Object with pagination details | Object |
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"
}