Skip to content

Duplicate a monitor

POST
/servers/{id}/duplicate
curl --request POST \
--url https://app.tunnelhq.com/api/v1/servers/srv_42/duplicate \
--header 'X-API-Key: <X-API-Key>' \
--header 'X-Project-Id: prj_12'

Copies a tunnel or an Uptime check. The copy has the original’s name with “ (copy)” after it. It keeps the original’s project, group, settings, locations, tags, and alert channels. It takes no body, and each call makes a new copy.

  • Saved logins, such as a tunnel’s config or a check’s headers and passwords, are copied on TunnelHQ’s side. They never appear in the answer.
  • The copy starts paused only when the original is paused.
  • A mute and the original’s results aren’t copied, and neither is its place in the manual order: the copy shows at the top of its list in Manual order, as a new monitor does, until it’s moved.
  • A copied heartbeat gets an address of its own, in heartbeat_url.

A tunnel counts toward the plan’s tunnel limit, so a copy is refused with 403 at the limit. An Uptime check doesn’t count. A group can’t be duplicated, and neither can a tunnel from a subscription URL: both are refused with 400.

Needs a role that can edit monitors (Owner, Admin, and Manager by default).

Need an API key? See Getting an API key.

id
required
string

The monitor, as srv_42 or 42.

Example
srv_42
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 copy. Its first check is queued, so its status starts as pending, or paused when the original is paused.

Media typeapplication/json
object
id
required
string
name
required
string
type
required

vpn for a tunnel, or the Uptime check’s type (push is a heartbeat).

string
Allowed values: vpn http keyword ping port dns push
group_id
required

The group the monitor is in, or null when it’s in none.

string | null
protocol
required
One of:
string
Allowed values: wireguard amneziawg openvpn openconnect ikev2 vless vmess trojan shadowsocks hysteria2 tuic
status
required
  • healthy: its checks pass.
  • degraded: it answers, but the server refused the monitor’s login or credentials, or a tunnel’s test fails while its server’s own users stay connected. status_reason.code says which: credentials_rejected, login_rejected, or test_fails. The dashboard shows each as Degraded, and for test_fails it says Test fails as the reason under it. A check that is still being retried is never degraded.
  • partial_outage: down from some of its locations, not all of them.
  • down: its checks fail. For a heartbeat, no request arrived in time.
  • paused: the monitor is paused.
  • maintenance: a running maintenance window covers it.
  • pending: it hasn’t been checked yet. The dashboard shows Not checked yet.
  • no_data: it has had no result for longer than two of its own intervals. Never a heartbeat or a group. The dashboard shows No data. It’s also a tunnel or check that isn’t checked until its settings change, and status_reason.code says why: login_missing (the tunnel has no login, or one missing what its protocol needs), login_unreadable (its saved login can’t be read on this TunnelHQ server: send its whole config to replace it), request_unreadable (a website or keyword check’s saved login, request headers or body can’t be read here: enter them again), or address_refused (its server address is private or reserved). One that was down before stays down, with that reason.

When more than one could apply, paused comes first, then maintenance, then a tunnel or check that isn’t checked, then pending, then no_data, and then the newest results. Retrying after a first failure isn’t a state: status keeps the last confirmed value and confirming_failure is true. Values are only ever added, so treat one you don’t know as no_data.

string
Allowed values: healthy degraded partial_outage down paused maintenance pending no_data
aggregate_status
required

Always the same as status.

string
Allowed values: healthy degraded partial_outage down paused maintenance pending no_data
previous_status
required
One of:
  • healthy: its checks pass.
  • degraded: it answers, but the server refused the monitor’s login or credentials, or a tunnel’s test fails while its server’s own users stay connected. status_reason.code says which: credentials_rejected, login_rejected, or test_fails. The dashboard shows each as Degraded, and for test_fails it says Test fails as the reason under it. A check that is still being retried is never degraded.
  • partial_outage: down from some of its locations, not all of them.
  • down: its checks fail. For a heartbeat, no request arrived in time.
  • paused: the monitor is paused.
  • maintenance: a running maintenance window covers it.
  • pending: it hasn’t been checked yet. The dashboard shows Not checked yet.
  • no_data: it has had no result for longer than two of its own intervals. Never a heartbeat or a group. The dashboard shows No data. It’s also a tunnel or check that isn’t checked until its settings change, and status_reason.code says why: login_missing (the tunnel has no login, or one missing what its protocol needs), login_unreadable (its saved login can’t be read on this TunnelHQ server: send its whole config to replace it), request_unreadable (a website or keyword check’s saved login, request headers or body can’t be read here: enter them again), or address_refused (its server address is private or reserved). One that was down before stays down, with that reason.

When more than one could apply, paused comes first, then maintenance, then a tunnel or check that isn’t checked, then pending, then no_data, and then the newest results. Retrying after a first failure isn’t a state: status keeps the last confirmed value and confirming_failure is true. Values are only ever added, so treat one you don’t know as no_data.

string
Allowed values: healthy degraded partial_outage down paused maintenance pending no_data
status_since
required

When the status began, in ISO 8601 UTC. null when it isn’t known.

string | null format: date-time
status_reason
required

Why the monitor has its status.

object
code
required

Fixed, for code to match on: checks_pass, checks_fail, heartbeat_missed, down_in_some_locations, credentials_rejected, login_rejected, test_fails, paused, plan_limit, maintenance_window, not_checked_yet, no_recent_results, address_refused, login_missing, login_unreadable, or request_unreadable. Codes are only ever added.

string
message
required

A sentence to show a person. It may be reworded, so don’t match on it.

string
confirming_failure
required

true while a first failure is being checked again. status stays the last confirmed one until then.

boolean
last_checked_at
required

Its newest result, in ISO 8601 UTC. null before the first. A pause or resume isn’t a result.

string | null format: date-time
active
required

false when the monitor is paused.

boolean
interval
required

Seconds between scheduled checks.

integer | null
latency_ms
required

The latest check’s time, in milliseconds. For a tunnel, one round trip through the tunnel. For an Uptime check: the response time (website and keyword), the average round trip (ping), the TCP connect time (TCP port), the query time (DNS, null unless the server answered every question), or the ping value the job sent (heartbeat). Null when that check failed or measured none.

integer | null
connect_ms

Tunnels only: check rows don’t have it. How long the tunnel took to come up in its latest check, in milliseconds. Null when that check failed or measured none. For VLESS, VMess, Trojan, Shadowsocks, Hysteria2, and TUIC, it’s the time to first contact with the server.

integer | null
region
required

Where the latest check ran from, as any or a lowercase country code. null before the first check.

string | null
locations
required

The locations the monitor tests from. ["any"] unless specific locations were chosen.

Array<string>
disabled_locations
required

Locations that are paused. Never includes any.

Array<string>
regional_status
required

The latest result per location, keyed by location code. {} before the first check.

object
key
additional properties
object
status
required

A monitor’s values, and unavailable: no working checker is there, so the location is left out of the monitor’s status. A location whose newest check gave no verdict, because a failure is being retried or the checker couldn’t tell, is no_data.

string
Allowed values: healthy degraded partial_outage down paused maintenance pending no_data unavailable
last_check
required

When that location last checked, in ISO 8601 UTC. Empty if unknown.

string
ping_ms
required
number | null
error_category

Why the check failed, when it did.

string
proxy_used

Present only when the check ran through a relay.

boolean
notify_on_partial
required

Whether a partial outage alerts.

boolean
tags
required

Tag names.

Array<string>
last_checked
required

Its newest result, as the database writes it, in UTC as YYYY-MM-DD HH:MM:SS with no time zone marker. last_checked_at is the same time in ISO 8601.

string | null
subscription

Present only on monitors imported from a subscription URL. One monitor stands for every config in the URL that points at the same server.

object
subscription_url_id
string | null
server_address
string | null
server_name
string | null
config_count
integer
healthy_count
integer
sync_status

Whether the subscription it comes from can sync, as the dashboard shows it beside the monitor’s state: failing after a failed sync (Sync failing), stopped once TunnelHQ stopped retrying after 7 days of failed syncs (Sync stopped), and null while it syncs or hasn’t synced yet. The monitor’s own status stays its last check’s.

string | null
Allowed values: failing stopped
sync_error

The subscription’s last sync error, while sync_status is failing or stopped. null otherwise.

string | null
configs

The latest result for each config.

Array<object>
object
tag

The config’s name in the subscription.

string
type

The config’s protocol, such as vless.

string
server
string
port
integer | string
success
boolean
total_ms
number
error
string
error_category
string
public_ip

The address traffic left from, when the check passed.

string
engine_used
string
region_results

The same fields per location.

object
url

Uptime checks only: the address a website or keyword check requests. A caller whose role can’t edit checks reads it without its query string, its # part, or a user name and password before the host.

string | null
host

Uptime checks only: the host a ping or TCP port check reaches, or the DNS server a DNS check asks.

string | null
domain

Uptime checks only: the domain a DNS check asks about. null for other checks.

string | null
port

Uptime checks only: the TCP port check’s port, or 53 for DNS.

integer | null
keyword

Uptime checks only: the text a keyword check looks for, or the text a DNS answer must contain.

string | null
invert_keyword

Uptime checks only: true when a keyword check alerts on finding the keyword.

boolean
has_basic_auth

Website and keyword checks only: true when the check sends a Basic auth login. The login itself is never returned.

boolean
accepted_statuscodes

Uptime checks only: status codes that count as up, such as 200-299.

Array<string>
certificate

Uptime checks only: the certificate the latest check saw, or null before one was seen.

object
valid
boolean
days_remaining
integer
ssl_expiration

Uptime checks only: days before the certificate expires to alert. null is off.

integer | null
domain_expiration

Uptime checks only: days before the domain expires to alert. null is off.

integer | null
ip_version

Uptime checks only: ipv4 or ipv6, or null for both.

string | null
Allowed values: ipv4 ipv6
period

Heartbeats only: the longest time between two calls from the job, in seconds. interval shows the same value.

integer
grace

Heartbeats only: how late a call can be before the heartbeat is down, in seconds.

integer
last_call_at

Heartbeats only: when the job last called its address, whatever the call reported (up, /fail, or an exit code), in ISO 8601 UTC. Not last_checked_at, which for a down heartbeat is our own look that found no call. null when no call is on record: before the first call, or when the last one is older than the kept history.

string | null format: date-time
recent_calls

Heartbeats only: one entry per expected call, oldest first, up to 24, as the dashboard draws its pills.

Array<object>
object
due
required

When the call was expected.

string | null format: date-time
at
required

When it came. null when it was missed.

string | null format: date-time
state
required
string
Allowed values: on_time late failed missed
reason
required
string | null
by

Only on a missed call: when its grace ran out.

string format: date-time
call_in_grace

Heartbeats only: a call that is due and still inside its grace, or null.

object
due
string format: date-time
grace_until
string format: date-time
heartbeat_url

Heartbeats only, and only from Create, Get, and Update monitor, to callers who can edit monitors: the address the job calls. Treat it as a secret.

string
hosting_provider

Tunnels only: where the tunnel is hosted, such as OVH, or null when it isn’t set. Uptime checks don’t have this field.

string | null
alerts_muted_until

Only from Get monitor: when its muted alerts come back on, in ISO 8601, UTC, or null when they aren’t muted. Muted until unmuted reads 2099-12-31T23:59:59.000Z.

string | null
Example
{
"id": "srv_44",
"name": "fra-wg-01 (copy)",
"type": "vpn",
"group_id": "srv_40",
"protocol": "wireguard",
"status": "pending",
"aggregate_status": "pending",
"active": true,
"interval": 180,
"latency_ms": null,
"connect_ms": null,
"region": null,
"locations": [
"any"
],
"disabled_locations": [],
"regional_status": {},
"notify_on_partial": false,
"tags": [
"production"
],
"last_checked": null,
"previous_status": null,
"status_since": "2026-09-25T14:28:40.000Z",
"status_reason": {
"code": "not_checked_yet",
"message": "It has not been checked yet."
},
"confirming_failure": false,
"last_checked_at": null
}
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 ID isn’t a valid ID, or the monitor is a group or a tunnel from a subscription.

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": "Invalid server ID"
}

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 role or the plan doesn’t allow it, or the key can’t reach this project.

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": 403,
"message": "You do not have permission to edit this monitor"
}

The project has no such monitor, 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": "Server not found"
}

The tunnel has no login saved, or one missing what its protocol needs, so a copy would never be checked.

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": 422,
"message": "This tunnel has no login saved, so a copy would never be checked. Add its config in its settings first."
}

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