public.servers.list
const url = 'https://rest.watchtower15.com/v1/servers?os_type=linux&archived=true&sort=name&direction=asc&include_total=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://rest.watchtower15.com/v1/servers?os_type=linux&archived=true&sort=name&direction=asc&include_total=true' \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”ServersListResource
object
object
The display name when one is set, else the hostname.
The source address of the agent’s last heartbeat.
One of unknown, healthy, warning, critical.
One of active, pending_approval, revoked.
Why a pending_approval server waits: approval or limit.
Connected, catching up, delayed, unreachable, rejected, powered off or never seen: an open set. Null when no agent reports (pending, revoked, no agent, or monitoring off).
Epoch milliseconds.
Whether monitoring is switched on.
Epoch milliseconds; null for a server that is not archived.
object
The server’s page in the console.
The whole list’s size; present only with include_total=true.
Example generated
{ "data": [ { "uuid": "example", "name": "example", "hostname": "example", "ip_address": "example", "os_type": "example", "health_status": "example", "agent_status": "example", "pending_reason": "example", "connectivity_state": "example", "agent_version": "example", "agent_last_seen_at": 1, "active": true, "archived_at": 1, "tags": [ { "uuid": "example", "name": "example" } ], "console_url": "example" } ], "next_cursor": "example", "total": 1}The API key is missing, malformed, expired or revoked.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The key or its owner does not hold what the operation needs.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}No such record in this organisation (an absent id and another organisation’s answer alike).
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}The request is invalid; errors names the parameters.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}A rate limit or the organisation’s daily limit is reached; Retry-After says when to retry.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}An unexpected error.
object
https://docs.watchtower15.com/api/errors/<code>/
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "detail": "example", "request_id": "example", "errors": { "additionalProperty": [ "example" ] }, "limit": 1, "used": 1}