Skip to main content

Delete TURN Credential by Label

Use this endpoint to delete all active (non-expired) TURN credentials associated with a specific label. You must authenticate using your application's secretKey.


DELETE
https://<appname>.metered.live/api/v2/turn/credential/by_label

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


Request

DELETE /api/v2/turn/credential/by_label

Query Parameters

ParameterDescriptionData Type
secretKeyYour application's secret key, found in Dashboard → Developers → Secret Key (required).String
labelThe label that identifies the credentials you wish to delete. Must be fewer than 100 characters.String
Example Request
DELETE /api/v2/turn/credential/by_label?secretKey=<YOUR_SECRET_KEY>&label=my-labeled-credential

Responses

Success Response

Returns a JSON object indicating how many credentials were deleted:

FieldDescriptionData Type
deletedThe number of credentials that were successfully removed.Number

HTTP Status: 200 OK

Example Success Response
{
"deleted": 3
}

Error Responses

HTTP StatusMessageDescription
400secretKey is requiredThe secretKey query parameter was not provided.
400invalid secretKeyThe provided secretKey is invalid.
400Invalid request. Not subscribed to any turn server planThe application is not subscribed to a TURN server plan.
400Label must be a string of less than 100 charactersThe label parameter is invalid or exceeds the maximum length.

Code Examples

cURL

curl -X DELETE "https://<appname>.metered.live/api/v2/turn/credential/by_label?secretKey=<YOUR_SECRET_KEY>&label=my-label"

JavaScript (Fetch)

fetch(
`https://<appname>.metered.live/api/v2/turn/credential/by_label?secretKey=<YOUR_SECRET_KEY>&label=my-label`,
{
method: "DELETE",
}
)
.then((response) => response.json())
.then((data) => console.log("Credentials Deleted:", data.deleted))
.catch((error) => console.error("Error:", error));