MetriBeacon
Menu

GET Current authorized server summaries and removed identifiers.

/api/v1/devices/summaries

Read the latest values and contact status for up to 50 servers in one workspace. Browser sessions only. Unknown, removed or moved identifiers are returned in removed_ids without exposing other workspaces.

On this page

Access and permissions

Read the latest values and contact status for up to 50 servers in one workspace. Browser sessions only. Unknown, removed or moved identifiers are returned in removed_ids without exposing other workspaces.

Browser session: __Host-mb_session cookie.

Parameters and headers

FieldLocationType and limitsRequiredMeaning
workspace_idURL querystring; {"format":"uuid"}YesUUID of an owned workspace. When optional, omission selects the documented default or all owned workspaces.
device_idsURL queryarray<string; {"format":"uuid"}>; {"minItems":1,"maxItems":50}YesComma-separated, unique server IDs; between one and 50.

Request body

No request body.

Responses

Stable error codes
unauthorized
invalid_credential
session_revoked
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 401,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
workspace_scope
browser_session_required
invalid_origin
insufficient_scope
csrf
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 403,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
not_found
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 404,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
invalid_live
live_limit
invalid_selection
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 422,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
feature_unavailable
stream_unavailable
unavailable
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
Retry-Afterstring; {"pattern":"^[0-9]+$"}Seconds before retry. Preserve supported idempotency identifiers and respect the operation’s mutation semantics.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 503,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
feature_unavailable
unavailable
live_capacity
HeaderType and limitsMeaning
Cache-Controlstring; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"}Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation.
Content-Languagestring; {"enum":["en","de"]}Language of human-readable response text, resolved from Accept-Language or the documented browser preference. Technical codes and identifiers remain stable.
Referrer-PolicyJSON; {"enum":["strict-origin-when-cross-origin","no-referrer"]}The default referrer policy is strict-origin-when-cross-origin. Provider-login responses use no-referrer to protect login parameters.
Retry-Afterstring; {"pattern":"^[0-9]+$"}Seconds before retry. Preserve supported idempotency identifiers and respect the operation’s mutation semantics.
VarystringResponses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie.
X-Content-Type-OptionsJSON; {"const":"nosniff"}The browser must use the declared content type.
X-Frame-OptionsJSON; {"const":"DENY"}The response must not be embedded in a frame.
X-Request-IDstringServer-generated request identifier. Include this when reporting an error; inbound values are not trusted.

application/problem+json

FieldType and limitsRequiredMeaning
$ProblemYes—
$.codestringYesStable machine-readable error code
$.detailstringYesShort localized explanation without internal error details
$.instancestringYesUnique relative identifier /api/v1/requests/{request_id}; not a retrievable resource
$.messagestringYesTemporarily identical to detail for existing clients
$.message_keystringYesStable translation key for changing the displayed language without another request
$.message_paramsobject; {"additionalProperties":true}YesNamed, safely rendered message parameters; never arbitrary HTML
$.request_idstring; {"pattern":"^[0-9a-f]{32}$"}YesServer-generated diagnostic identifier. It contains no login token or credential.
$.statusinteger; {"maximum":599,"minimum":400}Yes—
$.titlestringYesLocalized HTTP status title
$.typestring; {"const":"about:blank"}Yes—
json
{
  "code": "demo",
  "detail": "Demo error detail; inspect the documented code.",
  "instance": "demo",
  "message": "Demo error detail; inspect the documented code.",
  "message_key": "errors.requestFailed",
  "message_params": {},
  "request_id": "00000000000000000000000000000000",
  "status": 503,
  "title": "Demo error",
  "type": "about:blank"
}

application/json

FieldType and limitsRequiredMeaning
$ServerSummarySnapshotYes—
$.workspace_idstring; {"format":"uuid"}Yes—
$.observed_atstring; {"format":"date-time"}Yes—
$.devicesarray<object>; {"maxItems":50}Yes—
$.devices[]objectYes—
$.devices[].idstringYesUUID of this resource. Keep the returned identifier for subsequent operations.
$.devices[].workspace_idstringYesUUID of the owning workspace. Access is checked against the authenticated account.
$.devices[].pausedbooleanYesWhether automatic monitor work is paused. Existing telemetry and historical data remain.
$.devices[].attentionbooleanYes—
$.devices[].last_heartbeat_atstring; {"format":"date-time"} | nullYesLast accepted device contact timestamp; null before the first contact.
$.devices[].last_heartbeat_at (anyOf 1)string; {"format":"date-time"}No—
$.devices[].last_heartbeat_at (anyOf 2)nullNo—
$.devices[].summaryMonitorListSummaryYesOptional metrics for this page only: stable IDs, values, units, freshness and source timestamps. Missing preferred metrics use current recorded alternatives; existing stale values remain visible. State groups distinguish confirmed yes, confirmed no and sources without a current value. A replacement identifies the missing metric and its reason. No additional collection is enabled.
$.devices[].summary.attention_reasonsarray<string; {"maxLength":128}>; {"maxItems":8}NoNames of up to eight unresolved alarms, critical alarms first. Includes acknowledged alarms and excludes archived rules.
$.devices[].summary.attention_reasons[]string; {"maxLength":128}Yes—
$.devices[].summary.attention_countinteger; {"minimum":0}NoTotal number of unresolved alarms represented by the monitor warning.
$.devices[].summary.statusstring; {"enum":["available","unavailable"]}Yes—
$.devices[].summary.targetstringYes—
$.devices[].summary.systemstringYes—
$.devices[].summary.interval_secondsinteger; {"minimum":0}Yes—
$.devices[].summary.metricsarray<object; {"additionalProperties":false}>; {"maxItems":3}Yes—
$.devices[].summary.metrics[]object; {"additionalProperties":false}Yes—
$.devices[].summary.metrics[].keystringYes—
$.devices[].summary.metrics[].valuenumber | string | nullYes—
$.devices[].summary.metrics[].unitstringYes—
$.devices[].summary.metrics[].freshnessstring; {"enum":["fresh","stale","missing","reported","scheduled"]}Yes—
$.devices[].summary.metrics[].reasonstringNo—
$.devices[].summary.metrics[].measured_atstring; {"format":"date-time"} | nullYes—
$.devices[].summary.metrics[].measured_at (anyOf 1)string; {"format":"date-time"}No—
$.devices[].summary.metrics[].measured_at (anyOf 2)nullNo—
$.devices[].summary.metrics[].valid_untilstring; {"format":"date-time"} | nullYes—
$.devices[].summary.metrics[].valid_until (anyOf 1)string; {"format":"date-time"}No—
$.devices[].summary.metrics[].valid_until (anyOf 2)nullNo—
$.devices[].summary.metrics[].sourcesarray<object; {"additionalProperties":false}>Yes—
$.devices[].summary.metrics[].sources[]object; {"additionalProperties":false}Yes—
$.devices[].summary.metrics[].sources[].series_idstring; {"format":"uuid"}No—
$.devices[].summary.metrics[].sources[].namestringYes—
$.devices[].summary.metrics[].sources[].measured_atstring; {"format":"date-time"} | nullYes—
$.devices[].summary.metrics[].sources[].valid_untilstring; {"format":"date-time"} | nullYes—
$.devices[].summary.metrics[].sources[].valuenumber | string | nullNo—
$.devices[].summary.metrics[].sources[].label_keystringNo—
$.devices[].summary.metrics[].sources[].componentstringNo—
$.devices[].summary.metrics[].sources[].freshnessstring; {"enum":["fresh","stale","missing"]}No—
$.devices[].summary.metrics[].sources[].unitstringNoOriginal unit of the individual source value; an empty string denotes a dimensionless value.
$.devices[].summary.metrics[].usednumberNo—
$.devices[].summary.metrics[].totalnumberNo—
$.devices[].summary.metrics[].coresnumberNo—
$.devices[].summary.metrics[].pathstringNo—
$.devices[].summary.metrics[].enginestringNo—
$.devices[].summary.metrics[].configuredinteger; {"minimum":0}No—
$.devices[].summary.metrics[].idstringYes—
$.devices[].summary.metrics[].label_keystringNo—
$.devices[].summary.metrics[].namestringNo—
$.devices[].summary.metrics[].componentstringNo—
$.devices[].summary.metrics[].kindstring; {"enum":["gauge","counter","boolean","enum"]}No—
$.devices[].summary.metrics[].aggregationstring; {"enum":["mean","min"]}No—
$.devices[].summary.metrics[].replacesobject; {"additionalProperties":false}No—
$.devices[].summary.metrics[].replaces.keystringYes—
$.devices[].summary.metrics[].replaces.reasonstringYes—
$.devices[].summary.metrics[].groupobject; {"additionalProperties":false}No—
$.devices[].summary.metrics[].group.totalinteger; {"minimum":0}Yes—
$.devices[].summary.metrics[].group.positiveinteger; {"minimum":0}Yes—
$.devices[].summary.metrics[].group.negativeinteger; {"minimum":0}Yes—
$.devices[].summary.metrics[].group.unknowninteger; {"minimum":0}Yes—
$.devices[].summary.favicon_urlstringNoRelative, authenticated image URL for the favicon of an HTTP or browser monitor.
$.devices[].summary.location_countinteger; {"minimum":0}Yes—
$.devices[].summary.platformstring; {"enum":["linux","darwin","windows"]}NoAgent-reported operating system. Omitted when it is unknown.
$.devices[].summary.last_value_received_atstring; {"format":"date-time"} | nullNoReceipt time of the latest retained original numeric or state value across active series. Excludes heartbeats, text events, disabled series and derived calculations. Null when no such value is available.
$.devices[].summary.last_value_received_at (anyOf 1)string; {"format":"date-time"}No—
$.devices[].summary.last_value_received_at (anyOf 2)nullNo—
$.devices[].summary.agent_updateAgentUpdateInfoNo—
$.devices[].summary.agent_update.operating_systemstringYes—
$.devices[].summary.agent_update.installed_versionstringYes—
$.devices[].summary.agent_update.latest_versionstringYes—
$.devices[].summary.agent_update.statestring; {"enum":["unknown","current","update_available"]}Yes—
$.devices[].summary.agent_update.reasonstringYes—
$.devices[].summary.agent_update.can_updatebooleanYes—
$.devices[].summary.agent_update.target_idstringYes—
$.devices[].summary.agent_update.jobAgentUpdateJobNo—
$.devices[].summary.agent_update.job.idstring; {"format":"uuid"}Yes—
$.devices[].summary.agent_update.job.installation_idstring; {"pattern":"^[0-9a-f]{32}$"}Yes—
$.devices[].summary.agent_update.job.statestring; {"enum":["pending","running","succeeded","failed","expired","unconfirmed"]}Yes—
$.devices[].summary.agent_update.job.phasestring; {"enum":["downloading","installing","restarting","completed"]}Yes—
$.devices[].summary.agent_update.job.targetAgentUpdateTargetYes—
$.devices[].summary.agent_update.job.target.commitstring; {"pattern":"^[0-9a-f]{40}$"}Yes—
$.devices[].summary.agent_update.job.target.versionstringYes—
$.devices[].summary.agent_update.job.target.created_atstring; {"format":"date-time"}Yes—
$.devices[].summary.agent_update.job.target.fileobject; {"additionalProperties":false}Yes—
$.devices[].summary.agent_update.job.target.file.namestringYes—
$.devices[].summary.agent_update.job.target.file.platformstring; {"enum":["linux","darwin","windows"]}Yes—
$.devices[].summary.agent_update.job.target.file.architecturestring; {"enum":["amd64","arm64"]}Yes—
$.devices[].summary.agent_update.job.target.file.kindstring; {"const":"binary"}Yes—
$.devices[].summary.agent_update.job.target.file.sha256string; {"pattern":"^[0-9a-f]{64}$"}Yes—
$.devices[].summary.agent_update.job.target.file.sizeinteger; {"minimum":1,"maximum":268435456}Yes—
$.devices[].summary.agent_update.job.requested_atstring; {"format":"date-time"}Yes—
$.devices[].summary.agent_update.job.updated_atstring; {"format":"date-time"}Yes—
$.devices[].summary.agent_update.job.claimed_atstring; {"format":"date-time"} | nullYes—
$.devices[].summary.agent_update.job.claimed_at (anyOf 1)string; {"format":"date-time"}No—
$.devices[].summary.agent_update.job.claimed_at (anyOf 2)nullNo—
$.devices[].summary.agent_update.job.finished_atstring; {"format":"date-time"} | nullYes—
$.devices[].summary.agent_update.job.finished_at (anyOf 1)string; {"format":"date-time"}No—
$.devices[].summary.agent_update.job.finished_at (anyOf 2)nullNo—
$.devices[].summary.agent_update.job.error_codestringYes—
$.devices[].summary.agent_update.job.monitor_idstring; {"format":"uuid"}Yes—
$.devices[].summary.agent_update.job.operation_idstring; {"format":"uuid"}Yes—
$.devices[].summary.agent_update.job.source_versionstring; {"maxLength":128}Yes—
$.devices[].summary.agent_update.job.source_sha256string; {"pattern":"^[0-9a-f]{64}$"}Yes—
$.devices[].expected_heartbeat_secondsinteger; {"minimum":1}Yes—
$.devices[].heartbeat_statusstring; {"enum":["fresh","stale","missing"]}Yes—
$.devices[].heartbeat_valid_untilstring; {"format":"date-time"} | nullYes—
$.devices[].heartbeat_valid_until (anyOf 1)string; {"format":"date-time"}No—
$.devices[].heartbeat_valid_until (anyOf 2)nullNo—
$.removed_idsarray<string; {"format":"uuid"}>; {"maxItems":50}Yes—
$.removed_ids[]string; {"format":"uuid"}Yes—

Retries and asynchronous work

This operation reads or validates without applying a resource mutation. Respect rate limits and credential lifetime.

Request examples

Replace demo IDs, timestamps and placeholders with your own values. For a retry, keep the same IDs, time and content. These examples do not run requests on this page.

Keep login links, codes, cookies and keys private. Do not print them in logs or share them in support requests.

shell
curl --silent --show-error --output /dev/null --write-out "%{http_code}\n" \
  --request GET \
  --header @"$HOME/.config/metribeacon/headers.txt" \
  "https://metribeacon.com/api/v1/devices/summaries?workspace_id=00000000-0000-4000-8000-000000000001&device_ids=00000000-0000-4000-8000-000000000002"
python
import json
from pathlib import Path
from urllib.request import Request, HTTPRedirectHandler, build_opener
from urllib.error import HTTPError

headers = json.loads((Path.home() / ".config/metribeacon/headers.json").read_text())
request = Request("https://metribeacon.com/api/v1/devices/summaries?workspace_id=00000000-0000-4000-8000-000000000001&device_ids=00000000-0000-4000-8000-000000000002", data=None, headers=headers, method="GET")
class NoRedirect(HTTPRedirectHandler):
    def redirect_request(self, request, fp, code, message, headers, target):
        return None

opener = build_opener(NoRedirect())
try:
    with opener.open(request, timeout=10) as response:
        print(response.status)
except HTTPError as error:
    print(error.code)
    error.close()
javascript
import { readFile } from "node:fs/promises";
import { homedir } from "node:os";
import { join } from "node:path";

const headers = JSON.parse(await readFile(join(homedir(), ".config/metribeacon/headers.json"), "utf8"));
const response = await fetch("https://metribeacon.com/api/v1/devices/summaries?workspace_id=00000000-0000-4000-8000-000000000001&device_ids=00000000-0000-4000-8000-000000000002", {
  method: "GET", headers, redirect: "manual",
  signal: AbortSignal.timeout(10000),
});
console.log(response.status);
await response.body?.cancel();
go
package main

import (
  "fmt"
  "net/http"
  "time"
  "encoding/json"
  "os"
  "path/filepath"
)

func main() {
  home, err := os.UserHomeDir(); if err != nil { panic("request failed; credentials and response omitted") }
  raw, err := os.ReadFile(filepath.Join(home, ".config/metribeacon/headers.json")); if err != nil { panic("request failed; credentials and response omitted") }
  var headers map[string]string
  if json.Unmarshal(raw, &headers) != nil { panic("invalid local headers") }
  request, err := http.NewRequest("GET", "https://metribeacon.com/api/v1/devices/summaries?workspace_id=00000000-0000-4000-8000-000000000001&device_ids=00000000-0000-4000-8000-000000000002", nil)
  if err != nil { panic("request failed; credentials and response omitted") }
  for name, value := range headers { request.Header.Set(name, value) }
  client := &http.Client{Timeout: 10*time.Second, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }}
  response, err := client.Do(request)
  if err != nil { panic("request failed; credentials and response omitted") }
  defer response.Body.Close()
  fmt.Println(response.StatusCode)
}