Get the availability report
const url = 'https://app.tunnelhq.com/api/v1/reports/availability?month=2026-10&by=tunnel&family=tunnel&sort=availability&dir=asc&format=csv';const options = {method: 'GET', headers: {'X-Project-Id': 'prj_12', 'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://app.tunnelhq.com/api/v1/reports/availability?month=2026-10&by=tunnel&family=tunnel&sort=availability&dir=asc&format=csv' \ --header 'X-API-Key: <X-API-Key>' \ --header 'X-Project-Id: prj_12'One month’s availability against the project’s target, as the dashboard’s Reports page shows it. Any role in the project can call it.
- With
by=tunnel, the default, there’s one row per monitor: its availability, how far it is above or below the target (gap), its downtime, incidents and longest outage in minutes, and its average latency. - With
by=grouporby=provider, there’s one row per dashboard group or per hosting provider: how many monitors it has, how many are below the target, their average availability, total downtime and incidents, and the worst one. Monitors with no group are inNo group, and those with no provider inNo provider set. A tunnel’s provider is set in its Settings in the dashboard, under Hosting provider, or withhosting_providerin Update monitor. - Availability is the share of the monitored time that wasn’t downtime, as on the monitor’s own page. Only down time counts against it; time a monitor is paused, in maintenance, not yet checked, or has no data is left out. Downtime is the month’s down incidents, counted inside the month, plus any day in which every check failed and no incident was open, for as long as its failed checks cover. A degraded incident isn’t downtime. Incidents and the longest outage come from the down incidents only.
- A row with no checks that month has
nullavailability and comes last, whatever the order. totalscovers every monitor of thefamily, whateverbyis.
Send Accept: text/csv, or format=csv, for the same rows as a CSV file, the file Export CSV gives
on the Reports page.
Need an API key? See Getting an API key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”The project, as prj_12 or 12. A workspace key can only reach its own workspace’s projects.
Example
prj_12Query Parameters
Section titled “Query Parameters”The month, as YYYY-MM. Left out, last month. This month works too, with complete set to false. Reports go back 13 months.
One row per tunnel, per group, or per hosting provider.
tunnel for VPN tunnels, uptime for Uptime checks, all for both.
A column of the rows to sort by, such as availability (the default), downtime_minutes, incidents, or name. A name that isn’t a column is refused with 400, which lists the columns.
asc for lowest first, desc for highest first.
csv for a CSV file, the same as Accept: text/csv.
Responses
Section titled “ Responses ”The report.
object
false for the month in progress.
The project’s availability target
Every monitor of the family, whatever by is.
object
Monitors in the report.
Monitors with checks that month.
The average of the measured monitors.
With by=tunnel: id, name, group, provider, availability, gap, downtime_minutes, incidents, longest_minutes, avg_ms, and checks. With by=group or by=provider: name, tunnels, below_target, availability, gap, downtime_minutes, incidents, and worst.
object
By tunnel only.
The monitor, the group, or the provider.
By tunnel only. No group when it’s in none.
By tunnel only. No provider set when none is set.
Percent, to 3 decimals. null with no checks that month.
Availability minus the target. Below zero missed it.
By tunnel only.
By tunnel only: the average latency.
By tunnel only: checks that month.
By group or provider: monitors in it.
By group or provider.
By group or provider: the monitor with the lowest availability.
Examples
By tunnel
{ "month": "2026-10", "month_label": "October 2026", "complete": true, "target": 99.9, "by": "tunnel", "family": "tunnel", "totals": { "tunnels": 2, "measured": 2, "availability": 99.712, "below_target": 1, "incidents": 3, "downtime_minutes": 129 }, "rows": [ { "id": "srv_57", "name": "sg-vless-01", "group": "Asia", "provider": "OVH", "availability": 99.524, "gap": -0.376, "downtime_minutes": 124, "incidents": 2, "longest_minutes": 98, "avg_ms": 141, "checks": 22310 }, { "id": "srv_42", "name": "fra-wg-01", "group": "Europe", "provider": "No provider set", "availability": 99.9, "gap": 0, "downtime_minutes": 5, "incidents": 1, "longest_minutes": 5, "avg_ms": 157, "checks": 14880 } ]}By hosting provider
{ "month": "2026-10", "month_label": "October 2026", "complete": true, "target": 99.9, "by": "provider", "family": "tunnel", "totals": { "tunnels": 2, "measured": 2, "availability": 99.712, "below_target": 1, "incidents": 3, "downtime_minutes": 129 }, "rows": [ { "name": "OVH", "tunnels": 1, "below_target": 1, "availability": 99.524, "gap": -0.376, "downtime_minutes": 124, "incidents": 2, "worst": "sg-vless-01" }, { "name": "No provider set", "tunnels": 1, "below_target": 0, "availability": 99.9, "gap": 0, "downtime_minutes": 5, "incidents": 1, "worst": "fra-wg-01" } ]}Example
"Tunnel","Group","Provider","Availability (percent)","Against target (percent)","Downtime (minutes)","Incidents","Longest (minutes)""sg-vless-01","Asia","OVH","99.524","-0.376","124","2","98""fra-wg-01","Europe","No provider set","99.9","0","5","1","5"Headers
Section titled “Headers”Requests the workspace’s plan allows per minute.
Requests left in the current minute.
Unix time, in seconds, when the current minute ends.
An option isn’t one the report takes, or the X-Project-Id header is missing or malformed.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 400, "message": "month must look like 2026-10"}{ "error": true, "code": 400, "message": "That month has not started yet."}{ "error": true, "code": 400, "message": "Reports go back 13 months."}{ "error": true, "code": 400, "message": "by must be one of tunnel, group, provider"}{ "error": true, "code": 400, "message": "family must be one of tunnel, uptime, all"}{ "error": true, "code": 400, "message": "dir must be asc or desc"}The API key is missing, wrong, expired, switched off, or no longer valid.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 401, "message": "API key is required. Provide X-API-Key header or Authorization: Bearer <key>"}{ "error": true, "code": 401, "message": "Invalid or expired API key"}{ "error": true, "code": 401, "message": "API key has expired"}{ "error": true, "code": 401, "message": "API key owner account is inactive"}{ "error": true, "code": 401, "message": "This API key's workspace access has been removed"}The key can’t reach this project.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": true, "code": 403, "message": "This API key is scoped to a different organization"}{ "error": true, "code": 403, "message": "You do not have access to this project"}The project doesn’t exist, or your role can’t open it.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Example
{ "error": true, "code": 404, "message": "Project not found"}A usage limit was reached, or this IP address made too many requests with a wrong key.
Usage limits are per workspace and plan: per minute (Retry-After: 60), per day
(Retry-After: 3600), and per month (no Retry-After). They use their own body shape.
An IP address may send 10 wrong keys a minute; one more is allowed every 6 seconds. While
that allowance is used up, every request from the address is refused, even one with a
valid key.
object
Seconds to wait. Absent for the monthly limit.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Examples
{ "error": "Rate limit exceeded", "message": "Per-minute limit of 60 requests exceeded", "retry_after": 60}{ "error": "Daily limit exceeded", "message": "Daily limit of 25000 requests exceeded", "retry_after": 3600}{ "error": "Monthly limit exceeded", "message": "Monthly limit of 250000 requests exceeded"}{ "error": true, "code": 429, "message": "Too many failed API key attempts from this address. Wait a few seconds and try again.", "retry_after": 6}Headers
Section titled “Headers”Seconds to wait. 60 for the per-minute limit, 3600 for the daily limit, 6 after wrong keys. Absent for the monthly limit.
Something failed on TunnelHQ’s side.
object
The HTTP status, repeated.
What went wrong.
More detail, on some errors.
Seconds to wait, on the 429 for wrong keys.
Example
{ "error": true, "code": 500, "message": "Internal server error"}