Skip to main content

Delete TURN Credential from a Project

Use this endpoint to delete a single TURN credential (by username) within a specific project. You can authenticate by providing either the secretKey (for your entire application) or the projectApiKey (for a specific project).



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

<appname> - Replace with the name of your app.
:projectId - The unique ID of the project from which the credential will be deleted.


Request

DELETE /api/v2/turn/project/:projectId/credential

Path Parameter

ParameterDescriptionData Type
projectIdThe unique ID of the project (must be a valid ObjectId)String

Query Parameters (Authentication)

ParameterDescriptionData Type
secretKeyThe secret key for your application, found in Dashboard → Developers → Secret Key. Only one of secretKey or projectApiKey is required.String
projectApiKeyThe API key for the specific project. Only one of secretKey or projectApiKey is required.String

Body Parameters

ParameterDescriptionTypeRequired
usernameThe TURN username of the credential you want to remove.StringYes
Example Request Body
{
"username": "c7e21d0a812c0c3fdb3af925"
}

Responses

Success Response

Returns a JSON object indicating the credential was removed:

FieldDescriptionData Type
successtrue if the credential was successfully removed.Boolean
messageConfirmation message.String

HTTP Status: 200 OK

Example Success Response
{
"success": true,
"message": "credential removed"
}

Error Responses

HTTP StatusMessageDescription
400username is required, please provide the username of the credential to be removed in the request bodyThe username field was not provided in the request body.
400credential of the specified username is not foundNo credential matching the provided username was found under the specified project.

Code Examples

cURL

curl -X DELETE "https://<appname>.metered.live/api/v2/turn/project/63fdb9f998c1abec0bd3e16c/credential?secretKey=<YOUR_SECRET_KEY>" \
-H "Content-Type: application/json" \
-d '{
"username": "c7e21d0a812c0c3fdb3af925"
}'

JavaScript (Fetch)

fetch(
`https://<appname>.metered.live/api/v2/turn/project/63fdb9f998c1abec0bd3e16c/credential?projectApiKey=<PROJECT_API_KEY>`,
{
method: "DELETE",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
username: "c7e21d0a812c0c3fdb3af925",
}),
}
)
.then((response) => response.json())
.then((data) => console.log("Delete Response:", data))
.catch((error) => console.error("Error:", error));