Skip to main content

Get Turn Server Projects

Use this endpoint to retrieve a list of all existing TURN Server projects for your application.


GET
https://<appname>.metered.live/api/v2/turn/projects?secretKey=<YOUR_SECRET_KEY>

<appname> - Replace with the name of your app.
<YOUR_SECRET_KEY> - Your secret key, found in the Dashboard → Developers → Secret Key.


Request

GET /api/v2/turn/projects?secretKey=<YOUR_SECRET_KEY>

Query Parameter

ParameterDescriptionData Type
secretKeyThe secret key of your application (required)String

Responses

Success Response

Returns an array of project objects. Each object has the following fields:

FieldDescriptionData Type
_idUnique identifier for the project.String
projectNameThe name of the project.String
quotaInBytesData usage quota (in bytes). 0 indicates no enforced quota (usage is still tracked).Number
webhookUrlWebhook URL for receiving usage notifications, or null if none is set.String
notificationEmailsA list of email addresses that receive notifications when quota is reached.Array
quotaExceededActionThe action performed when the project quota is exceeded (e.g., disable, notify, none).String
createdTimestamp (ISO 8601) indicating when the project was created.String

HTTP Status: 200 OK

Example Success Response
[
{
"_id": "63fdb9f998c1abec0bd3e16a",
"projectName": "CustomerA",
"quotaInBytes": 1073741824,
"webhookUrl": "https://example.com/webhook/quota",
"notificationEmails": ["ops@example.com", "alert@example.com"],
"quotaExceededAction": "disable",
"created": "2025-01-24T10:15:00.000Z"
},
{
"_id": "63fdb9f998c1abec0bd3e16b",
"projectName": "CustomerB",
"quotaInBytes": 0,
"webhookUrl": null,
"notificationEmails": [],
"quotaExceededAction": "none",
"created": "2025-01-25T08:30:00.000Z"
}
]

Error Responses

HTTP StatusMessageDescription
400invalid secretKey app not foundThe provided secretKey is invalid or does not match an existing app.
400Invalid request. Not subscribed to any turn server planThe application is not subscribed to a TURN server plan.

Code Examples

cURL

curl -X GET "https://<appname>.metered.live/api/v2/turn/projects?secretKey=<YOUR_SECRET_KEY>"

JavaScript (Fetch)

fetch(
`https://<appname>.metered.live/api/v2/turn/projects?secretKey=<YOUR_SECRET_KEY>`
)
.then((response) => response.json())
.then((data) => console.log("Projects:", data))
.catch((error) => console.error("Error:", error));