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
Parameter | Description | Data Type |
---|---|---|
secretKey | The secret key of your application (required) | String |
Responses
Success Response
Returns an array of project objects. Each object has the following fields:
Field | Description | Data Type |
---|---|---|
_id | Unique identifier for the project. | String |
projectName | The name of the project. | String |
quotaInBytes | Data usage quota (in bytes). 0 indicates no enforced quota (usage is still tracked). | Number |
webhookUrl | Webhook URL for receiving usage notifications, or null if none is set. | String |
notificationEmails | A list of email addresses that receive notifications when quota is reached. | Array |
quotaExceededAction | The action performed when the project quota is exceeded (e.g., disable , notify , none ). | String |
created | Timestamp (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 Status | Message | Description |
---|---|---|
400 | invalid secretKey app not found | The provided secretKey is invalid or does not match an existing app. |
400 | Invalid request. Not subscribed to any turn server plan | The 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));