Retrieve Available Regions
GET /regions
Retrieve the full list of regions supported by Turnix for TURN server allocation. These region identifiers can be used as values for the fixed_region
or preferred_region
fields in ICE credential requests.
🔐 Authentication
This endpoint requires a valid Bearer token in the Authorization
header.
Authorization: Bearer YOUR_API_TOKEN
📦 Example Request
- CURL
- Ruby
- Node.js
- Dart
- Java
curl -X GET \
https://turnix.io/api/v1/regions \
-H 'Authorization: Bearer YOUR_API_BEARER_TOKEN' \
require 'httparty'
response = HTTParty.get(
"https://turnix.io/api/v1/regions",
headers: {
"Authorization" => "Bearer YOUR_API_BEARER_TOKEN"
}
)
puts response.code # HTTP status code
puts response.body # Response body
const fetch = require('node-fetch');
(async () => {
try {
const response = await fetch('https://turnix.io/api/v1/regions', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_BEARER_TOKEN',
'Content-Type': 'application/x-www-form-urlencoded'
},
});
if (!response.ok) {
throw new Error(`Request failed with status ${response.status}`);
}
const data = await response.json();
console.log('Response:', data);
} catch (error) {
console.error('Error:', error.message);
}
})();
import 'package:http/http.dart' as http;
final headers = <String, String>{
'Authorization': 'Bearer $apiToken',
'Accept': 'application/json',
'Content-Type': 'application/json',
};
final response = await http.get(
Uri.parse("https://turnix.io/api/v1/regions"),
headers: headers,
);
final body = json.decode(response.body) as List<dynamic>;
import java.net.URI;
import java.net.http.*;
import java.time.Duration;
HttpClient client = HttpClient.newHttpClient();
String apiToken = "YOUR_API_TOKEN";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://turnix.io/api/v1/regions"))
.header("Authorization", "Bearer " + apiToken)
.header("Content-Type", "application/json")
.GET()
.timeout(Duration.ofSeconds(10))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
📥 Example Response
Response
[
{
"slug": "us-east",
"nat2": "us",
"city": "Washington, D.C.",
"name": "US East",
"lat": 38.9074694,
"lon": -77.0191375,
"is_online": true,
"is_operational": true
},
{
"slug": "eu-central",
"nat2": "de",
"city": "Karlsruhe",
"name": "EU Central",
"lat": 49.006889,
"lon": 8.403653,
"is_online": true,
"is_operational": true
},
{
"slug": "singapore",
"nat2": "sg",
"city": "Singapore",
"name": "Singapore",
"lat": 1.284550946,
"lon": 103.844292,
"is_online": false,
"is_operational": false
}
]