Resolve a server incident
const url = 'https://app.tunnelhq.com/api/v1/hosts/incidents/hin_12/resolve';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/hosts/incidents/hin_12/resolve \ --header 'X-API-Key: <X-API-Key>' \ --header 'X-Project-Id: prj_12'Closes an open incident about a country’s users by hand, as Resolve on its page does. It changes nothing
on the servers, and their blocks stay in each server’s history until the users come back. No Resolved message
goes out. can_resolve on the incident says whether it applies.
Every other server incident closes by itself once the server is back, and this answers 409 for it.
It needs a role that can edit monitors (Owner, Admin and Manager have it 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”Header 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 ”Resolved. The answer is the incident after the change.
object
One server incident as its page shows it.
object
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.
The service, metric (cpu, memory, disk) or country code, when the kind has one.
When its message went. Servers failing together share one message.
The email of who acknowledged it.
object
What the message was built from, such as a certificate’s expiry and names.
object
Country incidents only: the servers that still have users from the country, 11 or more each.
object
Country incidents only: what our tests of the servers saw, in a sentence.
The email of who resolved it by hand. null when it closed by itself.
Nobody was told: a shutdown, or every alert switched off.
Every server with users from the country lost them at once, at two or more hosting providers: a shutdown, not a block.
true for an open country incident: only those can be resolved by hand.
The newest report from any of its servers.
object
Country incidents only: its users from the country before they left, 30 or more.
Country incidents only: when they left.
Country incidents only: its hosting provider, from its linked tunnels.
Country incidents only: counts below this are never given.
Country incidents only: the hosting providers, in a sentence, such as “All 6 are at OVH.”
Country incidents only: the users from the country on these servers at this hour last week.
object
Country incidents only: how often the country check runs.
Oldest first: when servers joined and came back, where its messages went, acknowledgements, notes, and how it closed.
object
The note, on an acknowledgement or a note.
object
Example
{ "incident": { "id": "hin_3", "kind": "offline", "state": "open", "servers": [ { "id": "hst_7" } ], "under": 11, "checked_every_seconds": 300, "timeline": [ { "kind": "down", "title": "Alerted 2 channels", "aside": "both delivered" } ] }}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 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"}Your role can’t edit monitors.
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": 403, "message": "Changing a server needs a role that can edit monitors."}The project has no such server incident, 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": "No such server incident in this project."}{ "error": true, "code": 404, "message": "No such incident in this project."}{ "error": true, "code": 404, "message": "Project not found"}It isn’t about a country’s users, or it’s resolved already.
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": 409, "message": "This closes by itself once the server is back. Only an incident about a country's users can be resolved by hand."}{ "error": true, "code": 409, "message": "This incident is resolved already."}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"}