Skip to content

Get a server

GET
/hosts/{id}
curl --request GET \
--url https://app.tunnelhq.com/api/v1/hosts/hst_7 \
--header 'X-API-Key: <X-API-Key>' \
--header 'X-Project-Id: prj_12'

One server in full: its readings, system, the cloud it runs on, disks, biggest programs, users per country and blocks on a VPN server, linked tunnels and checks, alert settings, open incidents, and the command that uninstalls its agent. Any role in the project can call it.

Need an API key? See Getting an API key.

id
required
string

The server, as hst_7 or 7.

Example
hst_7
X-Project-Id
required
string

The project, as prj_12 or 12. A workspace key can only reach its own workspace’s projects.

Example
prj_12

The server.

Media typeapplication/json
object
id
string
name

The name a person gave it, else its hostname.

string
hostname
string | null
group
string | null
status

Online: a report in the last 60 seconds. Stale: 60 to 90 seconds. Offline: more than 90 seconds, or never. Connecting: installed in the last 3 minutes and no report yet.

string
Allowed values: online stale offline connecting
registered_at

When its agent was installed and registered.

string | null format: date-time
os
string | null
agent_version
string | null
agent_latest

The agent version TunnelHQ hands out now.

string | null
agent_update

A newer release than this server’s agent is out.

boolean
agent_can_update

The agent has the updater, so TunnelHQ can update it. False for one installed before updates came, or with --no-updates.

boolean
agent_auto_update

TunnelHQ updates this agent by itself, a day after each release.

boolean
agent_updating

The version on its way

string | null
agent_update_result

How the last update went, as the agent reported it.

object
version
string
from
string
ok
boolean
message
string
at
string
public_ip
string | null
public_ip6
string | null
country

The country of the server’s own address, as the agent reports it (agent 1.4.0 and later).

string | null
last_report_at
string | null format: date-time
seconds_since_report
integer | null
cpu_percent
number | null
memory_percent
number | null
disk_percent
number | null
load_1
number | null
health_score

0 to 100, where 0 is best: 0 means no sign of trouble for users, 100 that users are suffering now.

number | null
balance_score

0 to 100: how little room is left for more users (100: none).

number | null
load_score

0 to 100: how busy the server is overall.

number | null
packet_drop_rate

Drops per second on tunnel interfaces only (tun, wg, awg), so null on a server that runs only proxies.

number | null
nic_drop_rate

What the network card dropped per second. null until the agent sends it.

number | null
nic_interface
string | null
tcp_retransmit_percent

The share of TCP segments sent again. null until the agent sends it.

number | null
vpn_choice

off when someone said this is not a VPN server, whatever VPN services it runs; auto when TunnelHQ decides from its VPN services.

string
Allowed values: auto off
users

Users online now. null, never 0, while the server counts no users (users_counted: false).

integer | null
protocols

Users per VPN protocol. From agent 1.14.5, AmneziaWG users count under amneziawg, apart from wireguard. null while the server counts no users.

object | null
users_counted

false when this server counts no online users: the project’s Count online users is off (a no-log policy), or the server was installed with --no-users. Then no address is read or looked up, nothing about users leaves the server, and the Users chart, the country table and country block detection stop for it. null on a server with no VPN services.

boolean | null
users_unknown

True when the server counts users but its agent could not read them now, such as when OpenConnect’s occtl refuses it. users is then null, never 0. null on a server with no VPN services.

boolean | null
users_unknown_reason

Why the users are unknown, while users_unknown is true.

string | null
users_off_by

Who turned counting off: project, the project’s setting, or server, set on the server itself. null while it counts.

string | null
Allowed values: project server
counting_on_server

While counting is off, what the agent on the server does. off: it reads nothing. until_next_report: it stops at its next report. until_agent_updated: an agent older than this setting still counts on the server and TunnelHQ discards what it sends; update the agent to stop it. null while it counts.

string | null
Allowed values: off until_next_report until_agent_updated
reinstall_flags

What running the install command on this server again must carry to keep what was set there: --no-users, or "". Get the install command with host_id adds it for you.

string
services

The VPN services it watches.

object | null
hosting_services

Web servers, databases and the like, with their state (agent 1.6.0 and later).

object | null
cloud

The cloud the server runs on, as its agent reads it from the cloud’s own instance metadata service. null off these six clouds, and from an agent older than 12 Nov 2026. It never holds an account, project or instance id.

object
provider
required
string
Allowed values: aws gcp azure digitalocean hetzner oracle
machine_type
required

The machine type as the cloud names it, such as t3.small. null when the cloud gives none, as on DigitalOcean and Hetzner Cloud.

string | null
region
required
string | null
zone
required
string | null
summary
required

The line the server’s page shows.

string
monitors

Its linked tunnels and checks that you can see.

Array<object>
object
id
string
name
string
family
string
kind
string
Allowed values: tunnel check heartbeat
via

How it was linked: by hand, by address, by hostname, or call, a heartbeat whose calls come from this server’s public address and no other server’s. The first such call links it; the link moves to another server after 3 calls in a row from there.

string
Allowed values: manual address hostname call
reason

Why it is linked, in the words of the dashboard’s Linked column.

string | null
test_fails

Only on Get a server, and only on a tunnel whose test fails while this server’s users stay connected: Degraded, with Test fails as the reason. Left out otherwise.

boolean
open_incidents
integer
tags
Array<string>
memory_used_mb
number | null
memory_total_mb
number | null
swap_percent
number | null
load_5
number | null
load_15
number | null
steal_percent
number | null
iowait_percent
number | null
disk_read_bytes_per_sec
number | null
disk_write_bytes_per_sec
number | null
disks

Every disk the agent reports.

Array<object> | null
object
programs

The biggest programs by memory, up to 8.

Array<object>
object
name
string
memory_mb
number
change_24h_mb
number | null
running_seconds
integer | null
countries

Users per country, biggest first, on a VPN server. Countries under 11 users are counted under “Other”, rounded to the nearest 5, and the server’s users and protocols are rounded with it, so no subtraction gives a small country’s count. null while the server counts no users.

Array<object> | null
object
country
string
users
integer
system
object
os
string | null
kernel
string | null
arch
string | null
cpu_model
string | null
cpu_count
integer | null
memory_total_mb
number | null
uptime_seconds
integer | null
last_boot_at
string | null
network_interface
string | null
bandwidth_capacity_mbps
number | null
ips
Array<string>
country
string | null
alerts
object
offline
object
enabled
boolean
after_seconds
integer
service
object
enabled
boolean
after_seconds
integer
country
object
enabled
boolean
cert
object
enabled
boolean
days
integer
Allowed values: 7 14 21 30
resources
Array<object>
object
metric
string
Allowed values: cpu memory disk
above
number
>= 1 <= 100
for_seconds
integer
>= 60 <= 3600
enabled
boolean
watches

The server’s watches still running. One past its until day is left out.

Array<object>

A rule of your own on one reading of the server.

object
id
string
metric
string
Allowed values: users traffic cpu memory disk
when
string
Allowed values: above below falls_by
value
number
for_seconds
integer
>= 60 <= 3600
until

Its last day, in UTC. null is always.

string | null format: date
channels

Alert channel IDs as numbers. null sends it where the server’s other alerts go.

Array<integer> | null
enabled
boolean
internet

Its internet keeps breaking. Needs agent 1.11.0.

object
enabled
boolean
every
string
Allowed values: once hourly daily
incidents

Its open incidents.

Array<object>
object
id
string
kind

offline: it stopped reporting. service: a service stopped. resource: CPU, memory or disk above its level. country: users from one country gone. cert: its certificate expires soon. watch: a watch someone set. internet: its internet keeps breaking.

string
Allowed values: offline service resource country cert watch internet
subject

The service, metric (cpu, memory, disk) or country code, when the kind has one.

string | null
state
string
Allowed values: open resolved
opened_at
string | null format: date-time
sent_at

When its message went. Servers failing together share one message.

string | null format: date-time
resolved_at
string | null format: date-time
acknowledged
boolean
acknowledged_at
string | null format: date-time
acknowledged_by

The email of who acknowledged it.

string | null
servers
Array<object>
object
id
string
name
string
back
boolean
detail

What the message was built from, such as a certificate’s expiry and names.

object
still_have

Country incidents only: the servers that still have users from the country, 11 or more each.

Array<object>
object
id
string
name
string
users
integer
tests

Country incidents only: what our tests of the servers saw, in a sentence.

string | null
blocks

Its blocks by country of the last 90 days, newest first, as List a server’s blocks by country gives them. null on a server with no VPN services.

Array<object> | null

A time a VPN server’s users from one country were gone while its VPN services ran.

object
country
string
left_at

When the users left, to the 5 minutes the history keeps.

string format: date-time
back_at

null while they are still gone.

string | null format: date-time
users_before

Its users from the country before they left, 30 or more.

integer
last_week

Its users from the country at this hour last week, when known.

integer | null
under
integer
Allowed value: 11
every_server

Every server of the project with users from the country lost them at once.

boolean
shutdown

They were lost at two or more hosting providers at once: a shutdown, told to nobody.

boolean
incident_id

The incident it is in, or null when none opened.

string | null
others_still_without

While still gone: how many other servers of the project lost the same country and are still without it. null once back.

integer | null
uninstall_command

The command that removes the agent from the machine.

string
certificate

The certificate the server’s OpenConnect service serves, read by the agent every hour (agent 1.8.0). Null when it serves none. There is no revocation check.

object
not_after
string format: date-time
not_before
string | null format: date-time
days_left
integer | null
names
Array<string>
subject

Its common name.

string | null
issuer
string | null
serial
string | null
key
string | null
signature
string | null
tls_version
string | null
chain

Server certificate first, then the ones above it.

Array<object>
object
name
string
not_after
string
renewed_on_disk

True when the file on disk was renewed and OpenConnect still serves the old one.

boolean | null
trusted
boolean | null
trust_problem
string | null
first_seen

When TunnelHQ first saw this certificate.

string | null
checks

Each check passes (true), fails (false) or is not known (null).

Array<object>
object
key
string
Allowed values: validity hostname trusted chain tls strength disk
ok
boolean | null
Example
{
"id": "hst_7",
"status": "online",
"nic_interface": "eth0",
"vpn_choice": "auto",
"users_off_by": "project",
"counting_on_server": "off",
"cloud": {
"provider": "aws",
"region": "eu-central-1",
"zone": "eu-central-1a",
"summary": "AWS, t3.small, eu-central-1a"
},
"monitors": [
{
"id": "srv_81",
"family": "tunnel",
"kind": "tunnel",
"via": "manual",
"test_fails": true
}
],
"alerts": {
"offline": {
"enabled": true,
"after_seconds": 90
},
"service": {
"enabled": true,
"after_seconds": 60
},
"country": {
"enabled": false
},
"cert": {
"enabled": true,
"days": 14
},
"resources": [
{
"metric": "disk",
"above": 85,
"for_seconds": 300,
"enabled": true
}
],
"watches": [
{
"id": "w1",
"metric": "users",
"when": "above",
"value": 500,
"for_seconds": 600,
"until": "2026-11-16",
"channels": [
3
],
"enabled": true
}
],
"internet": {
"enabled": false,
"every": "hourly"
}
},
"incidents": [
{
"id": "hin_3",
"kind": "offline",
"state": "open"
}
],
"blocks": [
{
"country": "IR",
"under": 11,
"incident_id": "hin_12"
}
],
"certificate": {
"key": "RSA 2048",
"tls_version": "TLS 1.3",
"trust_problem": "self-signed",
"checks": [
{
"key": "validity"
}
]
}
}
X-RateLimit-Limit
integer

Requests the workspace’s plan allows per minute.

X-RateLimit-Remaining
integer

Requests left in the current minute.

X-RateLimit-Reset
integer

Unix time, in seconds, when the current minute ends.

The API key is missing, wrong, expired, switched off, or no longer valid.

Media typeapplication/json
object
error
required
boolean
code
required

The HTTP status, repeated.

integer
message
required

What went wrong.

string
details

More detail, on some errors.

retry_after

Seconds to wait, on the 429 for wrong keys.

integer
Examples
{
"error": true,
"code": 401,
"message": "API key is required. Provide X-API-Key header or Authorization: Bearer <key>"
}

The project has no server with this ID, or the project doesn’t exist.

Media typeapplication/json
object
error
required
boolean
code
required

The HTTP status, repeated.

integer
message
required

What went wrong.

string
details

More detail, on some errors.

retry_after

Seconds to wait, on the 429 for wrong keys.

integer
Examples
{
"error": true,
"code": 404,
"message": "No such server in this project."
}

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.

Media typeapplication/json
One of:
object
error
required
string
Allowed values: Rate limit exceeded Daily limit exceeded Monthly limit exceeded
message
required
string
retry_after

Seconds to wait. Absent for the monthly limit.

integer
Examples
{
"error": "Rate limit exceeded",
"message": "Per-minute limit of 60 requests exceeded",
"retry_after": 60
}
Retry-After
integer

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.

Media typeapplication/json
object
error
required
boolean
code
required

The HTTP status, repeated.

integer
message
required

What went wrong.

string
details

More detail, on some errors.

retry_after

Seconds to wait, on the 429 for wrong keys.

integer
Example
{
"error": true,
"code": 500,
"message": "Internal server error"
}