Skip to content

Search monitors

GET
/servers/search
curl --request GET \
--url 'https://app.tunnelhq.com/api/v1/servers/search?q=example&limit=50' \
--header 'X-API-Key: <X-API-Key>'

Finds VPN monitors by name in every project the key can reach, newest first. A workspace key searches its own workspace; an account-wide key searches every workspace you belong to. No X-Project-Id needed.

In these results project_id is the bare number; project_slug is the prefixed ID.

Need an API key? See Getting an API key.

q
required
string
<= 200 characters

Text the monitor’s name contains.

limit
integer
default: 50 >= 1 <= 500

The matching monitors.

Media typeapplication/json
object
servers
required
Array<object>
object
id
required
string
name
required
string
project_id
required

The project’s number, without its prefix.

integer
project_slug
required

The project’s ID, as X-Project-Id takes it.

string
project_name
required
string
protocol
required
One of:
string
Allowed values: wireguard amneziawg openvpn openconnect ikev2 vless vmess trojan shadowsocks hysteria2 tuic
total
required
integer
query
required

The search text, trimmed.

string
Example
{
"servers": [
{
"id": "srv_42",
"name": "fra-wg-01",
"project_id": 12,
"project_slug": "prj_12",
"project_name": "Europe",
"protocol": "wireguard"
}
],
"total": 1,
"query": "fra"
}
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 search text is missing or too long.

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": 400,
"message": "Missing ?q=<name> query"
}

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>"
}

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"
}