Skip to content

List server suggestions

GET
/hosts/suggestions
curl --request GET \
--url 'https://app.tunnelhq.com/api/v1/hosts/suggestions?host=hst_7&monitor=srv_41&kind=reinstall&limit=50' \
--header 'X-API-Key: <X-API-Key>' \
--header 'X-Project-Id: prj_12'

What TunnelHQ thinks belongs together or was added twice, the same list as N suggestions · Review on the Servers page. What it is sure of it links by itself; these wait for a person. Each kind, most costly first:

  • reinstall: the same machine installed twice; accept removes the old copy.
  • duplicate_monitor: a tunnel or check added twice, run from the same locations at the same interval and alerting the same channels; accept deletes the copy.
  • address_block: a tunnel or check linked to no server tests an address next to exactly one server’s.
  • name: a tunnel, check or heartbeat linked to no server carries exactly one server’s name in its own.
  • shared_heartbeat: a heartbeat whose calls come from an address several servers share; accept links the ones you choose.

A decision is kept, so a dismissed suggestion never comes back. You see suggestions only about monitors you can see. Any role in the project can call it.

Need an API key? See Getting an API key.

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
host
string

Only suggestions about this server.

Example
hst_7
monitor
string

Only suggestions about this tunnel, check or heartbeat.

Example
srv_41
kind
string
Allowed values: reinstall duplicate_monitor address_block name shared_heartbeat
q
string

Part of the sentence, or of a server’s or monitor’s name.

limit
integer
default: 50 >= 1 <= 500
cursor
string

next_cursor from the page before.

A page of suggestions, how many match, and how many of each kind.

Media typeapplication/json
object
suggestions
required
Array<object>
object
id
required

The same each time it is worked out, so a decision sticks to it.

string
kind
required
string
Allowed values: reinstall duplicate_monitor address_block name shared_heartbeat
sentence
required
string
reason
required

A few words of why.

string
reasons

The facts behind it, as the dashboard’s (i) shows them. Addresses appear only here.

Array<object>
object
code
required
string
message
required
string
hosts
required
Array<object>
object
id
string
name
string
monitors
required
Array<object>
object
id
string
name
string
removes
required

What accepting removes: the old server (host) or the copy (monitor). null when accepting links.

object
type
string
Allowed values: host monitor
id
string
name
string
actions
required

The two buttons, as the dashboard labels them, and the permission each needs.

object
accept
object
label
string
Allowed values: Link Remove old copy Delete copy
permission
string
Allowed values: monitor.edit monitor.delete
takes
string
Allowed value: host_ids
dismiss
object
label
string
Allowed values: Not the same Keep both Neither
permission
string
Allowed value: monitor.edit
total
required

Every suggestion that matches, past this page.

integer
counts
required

How many of each kind match host, monitor and q, before kind.

object
key
additional properties
integer
next_cursor
required
string | null
Example
{
"suggestions": [
{
"id": "sug_block-7-41",
"kind": "reinstall",
"sentence": "Frankfurt WG looks like it runs on fra-1",
"removes": {
"type": "host"
},
"actions": {
"accept": {
"label": "Link",
"permission": "monitor.edit",
"takes": "host_ids"
},
"dismiss": {
"label": "Not the same",
"permission": "monitor.edit"
}
}
}
]
}
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.

A filter has a value it doesn’t take.

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": 400,
"message": "kind must be one of reinstall, duplicate_monitor, address_block, name, shared_heartbeat."
}

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

No active project has this ID.

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": 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.

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