Skip to main content

Update TURN Credential Label

This endpoint is used to update the label for the TURN Credential.


POST
    https://<appname>.metered.live/api/v2/turn/credential/update_label

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

Request

POST /api/v1/turn/credential

Query Parameters

ParameterDescriptionData Type
secretKeyThe secret key for app identificationString
usernameThe username of the credential for which you want to update the labelString

Request Body

The request body should be a JSON object with the following fields:

FieldDescriptionData Type
labelNew Label for the CredentialString

Responses

Success Response

A JSON object containing the updated TURN credential information:

FieldDescriptionData Type
usernameThe username of the credentialString
passwordThe password of the credentialString
expiryInSecondsThe time in seconds for the credential to expireInteger
labelThe label for the credentialString
apiKeyThe apiKey of the credentialString

HTTP Status: 200 OK

Body:

{
"username": "<username>",
"password": "<password>",
"expiryInSeconds": 3600,
"label": "<label>",
"apiKey": "<apiKey>"
}

Error Responses

HTTP Status: 400 Bad Request

Body:

{
"message": "credential of the specified username not found"
}

Code Examples

JavaScript (Fetch API)

fetch("https://<appname>.metered.live/api/v2/turn/credential/update_label?username=<USERNAME>&secretKey=<YOUR_SECRET_KEY>", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
"label": "exampleLabel"
}),
})