Skip to content

Get a check's SSL certificate

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

A website or keyword check’s SSL certificate, as the SSL certificate panel on the check’s page shows it. Any role in the project can call it. A tunnel, or any other kind of check, is refused with 404.

  • state is valid, soon (inside the alert window: 14 days, or the check’s expiry alert when that’s longer), expired, invalid (not trusted, or not for the check’s host), or unread (no connection over HTTPS yet). problem says why in a few words, such as Self signed, Incomplete chain, Untrusted root, or Not for shop.example.com.
  • certificate is what the check’s last successful connection saw. It’s null until one is read. days_left counts down to not_after from now.
  • Each of checks has ok: true, false, or null when it can’t be told.
  • alert_days is the check’s expiry alert, 0 when it’s off. Change it with ssl_expiration on PUT /servers/:id.
  • ignores_tls is true when the check stays up with a bad certificate.
  • domain is the domain’s registration when the check watches it, and null otherwise.

The answer never holds the check’s address, its headers, body, or login, or a client certificate or key.

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 check’s certificate.

Media typeapplication/json
object
host
required

The host the certificate must cover.

string
state
required
string
Allowed values: valid soon expired invalid unread
problem
required

Why it is expired or invalid, in a few words. null otherwise.

string | null
every_sec
required

How often the check runs, in seconds. It reads the certificate on every run.

integer
alert_days
required

Days before expiry that the alert opens. 0 is off.

integer
reminders
required

true when the alert also reminds 7 days and 1 day before expiry.

boolean
ignores_tls
required

true when the check stays up with an invalid or expired certificate.

boolean
certificate
required

What the check’s last successful connection saw. null until one is read.

object
not_after
string format: date-time
not_before
string | null format: date-time
days_left

Whole days until not_after. Negative once it has passed.

integer | null
names

The hostnames it covers.

Array<string>
subject

Its common name.

string | null
issuer
string | null
serial
string | null
key
string | null
signature
string | null
tls_version
string | null
chain

The certificate, then each issuer up to the root, as far as the check saw them.

Array<object>
object
name
string
issuer
string
not_after
string format: date-time
renewed_on_disk

Always null for a check. A server’s certificate fills it.

null
trusted
boolean | null
trust_problem
string | null
Allowed values: expired not yet valid self-signed unknown authority incomplete chain not trusted
first_seen

When TunnelHQ first saw this certificate.

string | null format: date-time
checks
Array<object>
object
key
required
string
Allowed values: validity hostname trusted chain tls strength
ok
required

null when it can’t be told.

boolean | null
hosts

hostname only: the hosts it must cover.

Array<string>
uncovered

hostname only: the hosts it doesn’t cover.

Array<string>
problem

trusted only: why it isn’t trusted.

string | null
domain
required

The domain’s registration, when the check watches it.

object
domain
string
expires_at
string format: date-time
days_left
integer
alert_days
integer
Example
{
"host": "shop.example.com",
"state": "soon",
"problem": null,
"every_sec": 60,
"alert_days": 14,
"reminders": true,
"ignores_tls": false,
"certificate": {
"not_after": "2026-11-25T22:56:00.000Z",
"not_before": "2026-08-27T22:56:00.000Z",
"days_left": 12,
"names": [
"shop.example.com",
"www.shop.example.com"
],
"subject": "shop.example.com",
"issuer": "R11 · Let's Encrypt",
"serial": "04:A1:7E:3B:9C:52:D0:18:6F",
"key": "ECDSA P-256",
"signature": "RSA with SHA-256",
"tls_version": "TLS 1.3",
"chain": [
{
"name": "shop.example.com",
"issuer": "R11",
"not_after": "2026-11-25T22:56:00.000Z"
},
{
"name": "R11",
"issuer": "ISRG Root X1",
"not_after": "2027-03-12T23:59:59.000Z"
}
],
"renewed_on_disk": null,
"trusted": true,
"trust_problem": null,
"first_seen": "2026-08-28T06:10:00.000Z",
"checks": [
{
"key": "validity",
"ok": true
},
{
"key": "hostname",
"ok": true,
"hosts": [
"shop.example.com"
],
"uncovered": []
},
{
"key": "trusted",
"ok": true,
"problem": null
},
{
"key": "chain",
"ok": true
},
{
"key": "tls",
"ok": true
},
{
"key": "strength",
"ok": true
}
]
},
"domain": {
"domain": "example.com",
"expires_at": "2027-08-13T04:00:00.000Z",
"days_left": 273,
"alert_days": 30
}
}
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 monitor ID isn’t valid, or the X-Project-Id header is missing or malformed.

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 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": "This API key is scoped to a different organization"
}

There’s no such monitor in the project, or it isn’t a website or keyword check on https://.

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

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