Duplicate a monitor
const url = 'https://app.tunnelhq.com/api/v1/servers/srv_42/duplicate';const options = { method: 'POST', 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 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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The monitor, as srv_42 or 42.
Example
srv_42Header 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_12Responses
Section titled “ Responses ”The copy. Its first check is queued, so its status starts as pending, or paused when the original is paused.
object
vpn for a tunnel, or the Uptime check’s type (push is a heartbeat).
The group the monitor is in, or null when it’s in none.
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.codesays which:credentials_rejected,login_rejected, ortest_fails. The dashboard shows each as Degraded, and fortest_failsit says Test fails as the reason under it. A check that is still being retried is neverdegraded.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, andstatus_reason.codesays 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), oraddress_refused(its server address is private or reserved). One that wasdownbefore staysdown, 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.
Always the same as status.
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.codesays which:credentials_rejected,login_rejected, ortest_fails. The dashboard shows each as Degraded, and fortest_failsit says Test fails as the reason under it. A check that is still being retried is neverdegraded.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, andstatus_reason.codesays 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), oraddress_refused(its server address is private or reserved). One that wasdownbefore staysdown, 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.
When the status began, in ISO 8601 UTC. null when it isn’t known.
Why the monitor has its status.
object
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.
A sentence to show a person. It may be reworded, so don’t match on it.
true while a first failure is being checked again. status stays the last confirmed one until then.
Its newest result, in ISO 8601 UTC. null before the first. A pause or resume isn’t a result.
false when the monitor is paused.
Seconds between scheduled checks.
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.
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.
Where the latest check ran from, as any or a lowercase country code. null before the first check.
The locations the monitor tests from. ["any"] unless specific locations were chosen.
Locations that are paused. Never includes any.
The latest result per location, keyed by location code. {} before the first check.
object
object
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.
When that location last checked, in ISO 8601 UTC. Empty if unknown.
Why the check failed, when it did.
Present only when the check ran through a relay.
Whether a partial outage alerts.
Tag names.
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.
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
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.
The subscription’s last sync error, while sync_status is failing or stopped. null otherwise.
The latest result for each config.
object
The config’s name in the subscription.
The config’s protocol, such as vless.
The address traffic left from, when the check passed.
The same fields per location.
object
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.
Uptime checks only: the host a ping or TCP port check reaches, or the DNS server a DNS check asks.
Uptime checks only: the domain a DNS check asks about. null for other checks.
Uptime checks only: the TCP port check’s port, or 53 for DNS.
Uptime checks only: the text a keyword check looks for, or the text a DNS answer must contain.
Uptime checks only: true when a keyword check alerts on finding the keyword.
Website and keyword checks only: true when the check sends a Basic auth login. The login itself is never returned.
Uptime checks only: status codes that count as up, such as 200-299.
Uptime checks only: the certificate the latest check saw, or null before one was seen.
object
Uptime checks only: days before the certificate expires to alert. null is off.
Uptime checks only: days before the domain expires to alert. null is off.
Uptime checks only: ipv4 or ipv6, or null for both.
Heartbeats only: the longest time between two calls from the job, in seconds. interval shows the same value.
Heartbeats only: how late a call can be before the heartbeat is down, in seconds.
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.
Heartbeats only: one entry per expected call, oldest first, up to 24, as the dashboard draws its pills.
object
When the call was expected.
When it came. null when it was missed.
Only on a missed call: when its grace ran out.
Heartbeats only: a call that is due and still inside its grace, or null.
object
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.
Tunnels only: where the tunnel is hosted, such as OVH, or null when it isn’t set. Uptime checks don’t have this field.
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.
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}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.
The ID isn’t a valid ID, or the monitor is a group or a tunnel from a subscription.
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": "Invalid server ID"}{ "error": true, "code": 400, "message": "A group is not duplicated: make a new group (create_group) and move monitors into it."}{ "error": true, "code": 400, "message": "A tunnel from a subscription is kept in step with its subscription, so it cannot be duplicated. Add it again as a tunnel of its own."}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 role or the plan doesn’t allow it, or 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": "You do not have permission to edit this monitor"}{ "error": true, "code": 403, "message": "Tunnel limit reached (20/20). Upgrade your plan to add more."}{ "error": true, "code": 403, "message": "Your plan does not allow adding monitors. Please upgrade."}{ "error": true, "code": 403, "message": "VPN protocol testing is not available on your plan. Upgrade to use this feature."}The project has no such monitor, or the project doesn’t exist.
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": 404, "message": "Server not found"}{ "error": true, "code": 404, "message": "Project not found or inactive"}The tunnel has no login saved, or one missing what its protocol needs, so a copy would never be checked.
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": 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.
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"}