Get the logo and icons from the website
const url = 'https://dev.tunnelhq.com/api/v1/status-pages/sp_12/brand-from-website';const options = { method: 'POST', headers: { 'X-Project-Id': 'prj_12', 'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json' }, body: '{"use":["logo","logo_dark","favicon"]}'};
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://dev.tunnelhq.com/api/v1/status-pages/sp_12/brand-from-website \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --header 'X-Project-Id: prj_12' \ --data '{ "use": [ "logo", "logo_dark", "favicon" ] }'Reads the page’s website_url and saves what you ask for in use from what it finds. Left out, use takes
everything found. Send [] to only see what the site offers.
logo: the mark in the site’s header, the link to its home page. An SVG drawn in the text colour also giveslogo_dark, in the page’s dark text colour. With no mark there, the site’s Apple touch icon.favicon: the site’s icon, an SVG first, then the largest PNG, then/favicon.ico.share_image: the site’sog:image(ortwitter:image), as a PNG or JPEG.
Each picture is held to the same types and sizes as one you send yourself. A new logo hands logo_with_name back to
the logo’s shape. A page can fetch once every 10 seconds. It needs a role that can edit the project (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_12Request Body
Section titled “Request Body”object
What to save from what is found. Left out, everything found.
Example
{ "use": [ "logo", "logo_dark", "favicon" ]}Responses
Section titled “ Responses ”What the website offers, what was saved, and the page.
object
The website’s host, without www..
Which pictures the website offers.
object
What was saved on the page.
object
The page’s own address, without https://.
Where visitors find the page. It uses the custom domain only when the page is published and domain_state is active.
A published page has changes that wait for a publish.
none: no custom domain is set.waiting: set, but its record doesn’t point to TunnelHQ yet.domain_notesays what the check found.issuing: the record points here and the HTTPS certificate is being made.active: live, with HTTPS.failed: the certificate failed.domain_notesays why.
What the last check found
The record the custom domain needs, one CNAME to cname.tunnelhq.net; empty without a custom domain. For a bare
domain it’s named @: add it as your DNS provider’s CNAME flattening, ALIAS or ANAME record.
The record a custom domain needs, named as DNS providers name it: relative to your zone, status for status.example.com and @ for example.com itself.
object
Whether the page is behind a password.
Lowercase #rrggbb, or null.
logo: the logo and Subscribe. site: with Status, History and Maintenance tabs too.
bars: 90 days of bars under each service. folded: one line each, bars on a click.
Whether the name shows beside the logo now: your choice, or until you make one, the logo’s shape.
Other languages visitors can choose.
The text a new update starts with, for each status. Sending it replaces the whole set; a status left out is empty.
object
Services as visitors see them, hidden ones included: a server’s tunnels on one host count once, a group counts its members.
object
The section’s heading; empty for none.
object
The name shown on the page.
On the page’s setup, but not shown to visitors.
The monitor’s own name.
The monitor’s type, such as vpn, http or group.
A tunnel’s protocol, such as wireguard; null for other monitors.
A group’s members, one level deep. Empty for anything else.
object
Example
{ "source": "larkspur.example", "found": { "logo": true, "logo_dark": true, "favicon": true, "share_image": false }, "applied": [ "logo", "logo_dark", "favicon" ], "status_page": { "id": "sp_12", "name": "Larkspur VPN", "website_url": "https://larkspur.example/", "has_logo": true, "has_dark_logo": true, "has_favicon": true, "has_share_image": false, "logo_with_name": true }}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 page has no website, the website couldn’t be read, or use isn’t 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": 400, "message": "Add the page's website under General first."}{ "error": true, "code": 400, "message": "Could not read larkspur.example: it did not answer."}{ "error": true, "code": 400, "message": "use must be a list of logo, logo_dark, favicon, share_image."}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 can’t edit the project.
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 status pages needs a role that can edit this project."}The project has no status page with this ID.
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": 404, "message": "No such status page."}The page fetched its website less than 10 seconds ago, or the key is over its usage limit (see TooManyRequests).
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": 429, "message": "It was fetched a moment ago. Try again in a few seconds."}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"}