Skip to main content

Disable TURN Credential

This endpoint allows you to disable a TURN credential associated with a specified username.


POST
    https://<appname>.metered.live/api/v1/turn/credential/disable

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

Request

POST /api/v1/turn/credential/disable

Query Parameters

ParameterDescriptionData Type
secretKeyThe secret key for authenticationString

Body Parameters

ParameterDescriptionData Type
usernameThe username for the TURN credential to disableString

Responses

Success Response

HTTP Status: 200 OK

Body:

{
"message": "Turn credential disabled successfully"
}

Error Responses

  • Invalid Secret Key:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "Invalid request. App not found"
    }
  • Not Subscribed to Any TURN Server Plan:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "Invalid request. Not subscribed to any turn server plan"
    }
  • Missing username Field in Request Body:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "`username` field missing in the request body"
    }
  • Credential Not Found:

    HTTP Status: 401 Unauthorized

    Body:

    {
    "message": "credential not found"
    }
  • Credential Already Disabled:

    HTTP Status: 400 Bad Request

    Body:

    {
    "message": "credential is already disabled"
    }
  • Internal Server Error:

    HTTP Status: 500 Internal Server Error

    Body:

    {
    "message": "Internal server error occurred. If the problem persists, contact support"
    }

Code Examples

JavaScript (Fetch API)

fetch("/api/v1/turn/credential/disable?secretKey=<YOUR_SECRET_KEY>", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
username: "<YOUR_USERNAME>"
})
})