curl --request POST \
--url https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2025-10-29T10:00:00Z",
"to": "2025-10-29T11:00:00Z",
"tunnels": [
"9f9510bd-a425-4d9d-a7cf-f845a39e26db",
"a1b2c3d4-e5f6-7890-1234-567890abcdef"
],
"datapoints": 50
}
'import requests
url = "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats"
payload = {
"from": "2025-10-29T10:00:00Z",
"to": "2025-10-29T11:00:00Z",
"tunnels": ["9f9510bd-a425-4d9d-a7cf-f845a39e26db", "a1b2c3d4-e5f6-7890-1234-567890abcdef"],
"datapoints": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2025-10-29T10:00:00Z',
to: '2025-10-29T11:00:00Z',
tunnels: ['9f9510bd-a425-4d9d-a7cf-f845a39e26db', 'a1b2c3d4-e5f6-7890-1234-567890abcdef'],
datapoints: 50
})
};
fetch('https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2025-10-29T10:00:00Z',
'to' => '2025-10-29T11:00:00Z',
'tunnels' => [
'9f9510bd-a425-4d9d-a7cf-f845a39e26db',
'a1b2c3d4-e5f6-7890-1234-567890abcdef'
],
'datapoints' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats"
payload := strings.NewReader("{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}"
response = http.request(request)
puts response.read_body{
"timestamps": [
1761619200000,
1761619500000,
1761619800000
],
"data": [
{
"tunnel_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"latency": [
12.5,
13.1,
null,
12.8
],
"packet_loss": [
0,
0,
100,
0.1
],
"mdev": [
1.2,
1.5,
null,
1.3
]
}
]
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Get WAN tunnel ping statistics
Fetches aggregated time-series data for latency, jitter (mdev), and packet loss for one or more WAN tunnels over a specified time period. If no tunnels are specified, it returns an aggregated average across all tunnels. This endpoint is optimized for creating performance charts with a specified number of data points.
curl --request POST \
--url https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "2025-10-29T10:00:00Z",
"to": "2025-10-29T11:00:00Z",
"tunnels": [
"9f9510bd-a425-4d9d-a7cf-f845a39e26db",
"a1b2c3d4-e5f6-7890-1234-567890abcdef"
],
"datapoints": 50
}
'import requests
url = "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats"
payload = {
"from": "2025-10-29T10:00:00Z",
"to": "2025-10-29T11:00:00Z",
"tunnels": ["9f9510bd-a425-4d9d-a7cf-f845a39e26db", "a1b2c3d4-e5f6-7890-1234-567890abcdef"],
"datapoints": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '2025-10-29T10:00:00Z',
to: '2025-10-29T11:00:00Z',
tunnels: ['9f9510bd-a425-4d9d-a7cf-f845a39e26db', 'a1b2c3d4-e5f6-7890-1234-567890abcdef'],
datapoints: 50
})
};
fetch('https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '2025-10-29T10:00:00Z',
'to' => '2025-10-29T11:00:00Z',
'tunnels' => [
'9f9510bd-a425-4d9d-a7cf-f845a39e26db',
'a1b2c3d4-e5f6-7890-1234-567890abcdef'
],
'datapoints' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats"
payload := strings.NewReader("{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/metrics/wan-tunnels/{tunnelId}/ping-stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"2025-10-29T10:00:00Z\",\n \"to\": \"2025-10-29T11:00:00Z\",\n \"tunnels\": [\n \"9f9510bd-a425-4d9d-a7cf-f845a39e26db\",\n \"a1b2c3d4-e5f6-7890-1234-567890abcdef\"\n ],\n \"datapoints\": 50\n}"
response = http.request(request)
puts response.read_body{
"timestamps": [
1761619200000,
1761619500000,
1761619800000
],
"data": [
{
"tunnel_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
"latency": [
12.5,
13.1,
null,
12.8
],
"packet_loss": [
0,
0,
100,
0.1
],
"mdev": [
1.2,
1.5,
null,
1.3
]
}
]
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The provided 'siteId' is not a valid UUID.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The WAN tunnel identifier.
"wan_2m3h5n7k9j8g7f6e5d4c3b2a1"
Body
The start of the time window.
"2025-10-29T10:00:00Z"
The end of the time window.
"2025-10-29T11:00:00Z"
An array of WAN Tunnel UUIDs to query. If omitted, an aggregate of all tunnels is returned.
[
"9f9510bd-a425-4d9d-a7cf-f845a39e26db",
"a1b2c3d4-e5f6-7890-1234-567890abcdef"
]
The desired number of data points in the response. The data will be aggregated to match this count, up to a maximum of 100.
50
Was this page helpful?