POST Report discovered server components and collection status
/api/v1/agent/server-report
Discovery and unsupported/permission-denied reports do not count as measurement values or enable selections. Accepted reports update only the key’s server monitor.
On this page
Access and permissions
Discovery and unsupported/permission-denied reports do not count as measurement values or enable selections. Accepted reports update only the key’s server monitor.
API write key in Authorization: Bearer. It allows data submission for the selected devices or all devices in its workspace.
Parameters and headers
| Field | Location | Type and limits | Required | Meaning |
|---|---|---|---|---|
| X-MetriBeacon-Device-ID | Header | string; {"format":"uuid"} | No | Target device UUID. Required for shared keys, implicit for one selected device. Header and body targets must match. |
Request body
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | object; {"additionalProperties":false} | Yes | — |
| $.agent_version | string; {"maxLength":128} | No | — |
| $.architecture | string; {"enum":["amd64","arm64"]} | No | — |
| $.capabilities | array<string>; {"maxItems":200} | No | — |
| $.capabilities[] | string | Yes | — |
| $.inventory | array<ServerComponent>; {"maxItems":200} | No | Bounded discovered server components; this does not execute arbitrary server commands. |
| $.inventory[] | ServerComponent | Yes | — |
| $.inventory[].address | string | No | — |
| $.inventory[].family | string | No | — |
| $.inventory[].id | string | Yes | UUID of this resource. Keep the returned identifier for subsequent operations. |
| $.inventory[].kind | string | Yes | Resource kind or measurement type selected from the listed values. |
| $.inventory[].label | string | Yes | Display name for the component. |
| $.inventory[].local_ref | string | No | — |
| $.inventory[].name | string | No | Human-readable resource name. Follow the listed length limit. |
| $.inventory[].path | string | No | — |
| $.inventory[].port | integer | No | — |
| $.inventory[].project | string | No | — |
| $.inventory[].protocol | string | No | — |
| $.inventory[].text_languages | object | No | — |
| $.inventory[].timeout_seconds | integer | No | — |
| $.inventory[].translations | object; {"additionalProperties":false} | No | — |
| $.inventory[].translations.de | object | No | — |
| $.inventory[].translations.en | object | No | — |
| $.inventory[].transport | string | No | — |
| $.inventory[].filesystem_identity | string; {"maxLength":256} | No | Agent-reported volume identity. Keep it unchanged to prevent a replacement volume from continuing another volume’s history. |
| $.inventory[].disk_identity | string; {"maxLength":256} | No | — |
| $.platform | string; {"enum":["linux","darwin","windows"]} | No | — |
| $.revision | integer; {"default":0,"minimum":0} | No | Resource revision for optimistic concurrency. Read the current revision before changing configuration. |
| $.statuses | array<CollectorStatus>; {"maxItems":200} | No | — |
| $.statuses[] | CollectorStatus | Yes | — |
| $.statuses[].component_id | string | Yes | — |
| $.statuses[].counter_epoch | string | No | — |
| $.statuses[].parameter_key | string | Yes | — |
| $.statuses[].source | string | No | — |
| $.statuses[].status | string; {"enum":["ready","warming_up","permission_denied","unsupported","failed"]} | Yes | — |
| $.system_info | SystemInformation | No | — |
| $.system_info.version | JSON; {"const":1} | Yes | — |
| $.system_info.operating_system | string; {"maxLength":256} | No | — |
| $.system_info.kernel_version | string; {"maxLength":256} | No | — |
| $.system_info.cpu_model | string; {"maxLength":256} | No | — |
| $.system_info.logical_cpu_cores | integer; {"minimum":0,"maximum":65536} | No | — |
| $.system_info.memory_total_bytes | integer; {"minimum":0,"maximum":1152921504606846976} | No | — |
| $.system_info.booted_at | string; {"format":"date-time"} | No | — |
| $.filesystems | object; {"additionalProperties":false} | No | — |
| $.filesystems.version | integer; {"enum":[1]} | Yes | — |
| $.filesystems.filesystems | array<object; {"additionalProperties":false}>; {"maxItems":200} | Yes | — |
| $.filesystems.filesystems[] | object; {"additionalProperties":false} | Yes | — |
| $.filesystems.filesystems[].component_id | string | Yes | — |
| $.filesystems.filesystems[].path | string | Yes | — |
| $.filesystems.filesystems[].identity | string; {"maxLength":256} | Yes | Agent-reported volume identity. Keep it unchanged to prevent a replacement volume from continuing another volume’s history. |
| $.filesystems.filesystems[].type | string | Yes | — |
| $.filesystems.incomplete | boolean | No | — |
| $.update_runtime | AgentUpdateRuntime | No | — |
| $.update_runtime.protocol | integer; {"const":1} | Yes | — |
| $.update_runtime.installation_id | string; {"pattern":"^[0-9a-f]{32}$"} | Yes | — |
| $.update_runtime.version | string; {"minLength":1,"maxLength":128} | Yes | — |
| $.update_runtime.enabled | boolean | Yes | — |
| $.update_runtime.channel | string; {"enum":["download","npm"]} | Yes | — |
| $.update_runtime.running_sha256 | string; {"pattern":"^[0-9a-f]{64}$"} | Yes | — |
| $.update_runtime.job_id | string; {"format":"uuid"} | No | — |
| $.system_inventory | object; {"additionalProperties":false} | No | — |
| $.system_inventory.version | integer; {"enum":[1]} | Yes | — |
| $.system_inventory.disks_known | boolean | Yes | — |
| $.system_inventory.disks | array<object; {"additionalProperties":false}>; {"maxItems":200} | Yes | — |
| $.system_inventory.disks[] | object; {"additionalProperties":false} | Yes | — |
| $.system_inventory.disks[].component_id | string; {"maxLength":192} | Yes | — |
| $.system_inventory.disks[].path | string; {"maxLength":1024} | Yes | — |
| $.system_inventory.disks[].label | string; {"maxLength":128} | Yes | — |
| $.system_inventory.disks[].identity | string; {"maxLength":256} | Yes | — |
| $.system_inventory.swap_active | boolean | null | Yes | — |
| $.system_inventory.process_count_available | boolean | Yes | — |
| $.system_inventory.disk_io | LogicalDiskIOInventory | null | No | — |
| $.system_inventory.disk_io (anyOf 1) | LogicalDiskIOInventory | No | — |
| $.system_inventory.disk_io (anyOf 1).complete | boolean | Yes | — |
| $.system_inventory.disk_io (anyOf 1).disk_count_known | boolean | Yes | — |
| $.system_inventory.disk_io (anyOf 1).disk_count | integer; {"minimum":0,"maximum":200} | Yes | — |
| $.system_inventory.disk_io (anyOf 1).source_count | integer; {"minimum":0,"maximum":1024} | Yes | — |
| $.system_inventory.disk_io (anyOf 1).source_set | string; {"maxLength":64} | Yes | — |
| $.system_inventory.disk_io (anyOf 2) | null | No | — |
| $.system_inventory.health | ServerHealthInventory | null | No | — |
| $.system_inventory.health (anyOf 1) | ServerHealthInventory | No | — |
| $.system_inventory.health (anyOf 1).version | integer; {"const":1} | Yes | — |
| $.system_inventory.health (anyOf 1).sources | array<ServerHealthSource>; {"maxItems":1200} | Yes | — |
| $.system_inventory.health (anyOf 1).sources[] | ServerHealthSource | Yes | — |
| $.system_inventory.health (anyOf 1).sources[].component | ServerComponent | Yes | — |
| $.system_inventory.health (anyOf 1).sources[].component.address | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.family | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.id | string | Yes | UUID of this resource. Keep the returned identifier for subsequent operations. |
| $.system_inventory.health (anyOf 1).sources[].component.kind | string | Yes | Resource kind or measurement type selected from the listed values. |
| $.system_inventory.health (anyOf 1).sources[].component.label | string | Yes | Display name for the component. |
| $.system_inventory.health (anyOf 1).sources[].component.local_ref | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.name | string | No | Human-readable resource name. Follow the listed length limit. |
| $.system_inventory.health (anyOf 1).sources[].component.path | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.port | integer | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.project | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.protocol | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.text_languages | object | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.timeout_seconds | integer | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.translations | object; {"additionalProperties":false} | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.translations.de | object | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.translations.en | object | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.transport | string | No | — |
| $.system_inventory.health (anyOf 1).sources[].component.filesystem_identity | string; {"maxLength":256} | No | Agent-reported volume identity. Keep it unchanged to prevent a replacement volume from continuing another volume’s history. |
| $.system_inventory.health (anyOf 1).sources[].component.disk_identity | string; {"maxLength":256} | No | — |
| $.system_inventory.health (anyOf 1).sources[].group | string; {"enum":["cpu_diagnostics_v1","disk_operations_v1","disk_latency_v1","network_errors_v1","swap_traffic_v1","psi_v1","filesystem_capacity_v1","filesystem_inodes_v1","filesystem_health_v1","oom_v1","storage_health_v1"]} | Yes | — |
| $.system_inventory.health (anyOf 1).sources[].status | string; {"enum":["ready","unsupported","permission_denied","failed"]} | Yes | — |
| $.system_inventory.health (anyOf 1).sources[].minimum_interval_seconds | integer; {"minimum":1,"maximum":86400} | Yes | — |
| $.system_inventory.health (anyOf 2) | null | No | — |
| $.delivery | AgentDeliveryReport | No | — |
| $.delivery.observed_at | string; {"format":"date-time"} | Yes | — |
| $.delivery.pending_objects | integer; {"minimum":0,"maximum":10000000} | Yes | — |
| $.delivery.pending_bytes | integer; {"minimum":0,"maximum":1073741824} | Yes | — |
| $.delivery.oldest_measured_at | string; {"format":"date-time"} | No | — |
| $.delivery.last_acknowledged_at | string; {"format":"date-time"} | No | — |
| $.delivery.retry_at | string; {"format":"date-time"} | No | — |
| $.delivery.lost_objects | integer; {"minimum":0} | Yes | — |
| $.delivery.last_error | object; {"additionalProperties":false} | No | — |
| $.delivery.last_error.at | string; {"format":"date-time"} | Yes | — |
| $.delivery.last_error.kind | string; {"enum":["timeout","connection","tls","http","ack","storage"]} | Yes | — |
| $.delivery.last_error.status | integer; {"minimum":0,"maximum":599} | No | — |
| $.delivery.last_error.code | string; {"enum":["","quota_exceeded","global_capacity","unavailable","http_error"]} | No | — |
| $.delivery.last_error.limit | string; {"enum":["","point_per_minute","point_per_day","event_per_minute","event_per_day","event_bytes_per_day","request_per_minute","bytes_per_minute","bytes_per_day","global_items"]} | No | — |
| $.resources | ServerResourceInventory | No | — |
| $.resources.version | integer; {"const":1} | Yes | — |
| $.resources.measured_at | string; {"format":"date-time"} | Yes | — |
| $.resources.complete | boolean | Yes | — |
| $.resources.filesystems | array<object; {"additionalProperties":false}>; {"maxItems":200} | Yes | — |
| $.resources.filesystems[] | object; {"additionalProperties":false} | Yes | — |
| $.resources.filesystems[].identity | string; {"minLength":1,"maxLength":256} | Yes | — |
| $.resources.filesystems[].capacity_id | string; {"maxLength":256} | Yes | — |
| $.resources.filesystems[].total_bytes | integer | null; {"minimum":0,"maximum":1152921504606846976} | Yes | — |
Responses
| Header | Type and limits | Meaning |
|---|---|---|
| Cache-Control | string; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"} | Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation. |
| Content-Language | string; {"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-Policy | JSON; {"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. |
| Vary | string | Responses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie. |
| X-Content-Type-Options | JSON; {"const":"nosniff"} | The browser must use the declared content type. |
| X-Frame-Options | JSON; {"const":"DENY"} | The response must not be embedded in a frame. |
| X-Request-ID | string | Server-generated request identifier. Include this when reporting an error; inbound values are not trusted. |
application/json
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | object | Yes | — |
| $.accepted | boolean | Yes | Number of newly accepted items in this response. |
| $.applied | boolean | Yes | — |
| $.revision | integer | Yes | Resource revision for optimistic concurrency. Read the current revision before changing configuration. |
{
"accepted": false,
"applied": false,
"revision": 0
}| Stable error codes |
|---|
| device_scope |
| Header | Type and limits | Meaning |
|---|---|---|
| Cache-Control | string; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"} | Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation. |
| Content-Language | string; {"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-Policy | JSON; {"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. |
| Vary | string | Responses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie. |
| X-Content-Type-Options | JSON; {"const":"nosniff"} | The browser must use the declared content type. |
| X-Frame-Options | JSON; {"const":"DENY"} | The response must not be embedded in a frame. |
| X-Request-ID | string | Server-generated request identifier. Include this when reporting an error; inbound values are not trusted. |
application/problem+json
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | Problem | Yes | — |
| $.code | string | Yes | Stable machine-readable error code |
| $.detail | string | Yes | Short localized explanation without internal error details |
| $.instance | string | Yes | Unique relative identifier /api/v1/requests/{request_id}; not a retrievable resource |
| $.message | string | Yes | Temporarily identical to detail for existing clients |
| $.message_key | string | Yes | Stable translation key for changing the displayed language without another request |
| $.message_params | object; {"additionalProperties":true} | Yes | Named, safely rendered message parameters; never arbitrary HTML |
| $.request_id | string; {"pattern":"^[0-9a-f]{32}$"} | Yes | Server-generated diagnostic identifier. It contains no login token or credential. |
| $.status | integer; {"maximum":599,"minimum":400} | Yes | — |
| $.title | string | Yes | Localized HTTP status title |
| $.type | string; {"const":"about:blank"} | Yes | — |
{
"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 |
|---|
| profile_missing |
| revision_conflict |
| Header | Type and limits | Meaning |
|---|---|---|
| Cache-Control | string; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"} | Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation. |
| Content-Language | string; {"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-Policy | JSON; {"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. |
| Vary | string | Responses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie. |
| X-Content-Type-Options | JSON; {"const":"nosniff"} | The browser must use the declared content type. |
| X-Frame-Options | JSON; {"const":"DENY"} | The response must not be embedded in a frame. |
| X-Request-ID | string | Server-generated request identifier. Include this when reporting an error; inbound values are not trusted. |
application/problem+json
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | Problem | Yes | — |
| $.code | string | Yes | Stable machine-readable error code |
| $.detail | string | Yes | Short localized explanation without internal error details |
| $.instance | string | Yes | Unique relative identifier /api/v1/requests/{request_id}; not a retrievable resource |
| $.message | string | Yes | Temporarily identical to detail for existing clients |
| $.message_key | string | Yes | Stable translation key for changing the displayed language without another request |
| $.message_params | object; {"additionalProperties":true} | Yes | Named, safely rendered message parameters; never arbitrary HTML |
| $.request_id | string; {"pattern":"^[0-9a-f]{32}$"} | Yes | Server-generated diagnostic identifier. It contains no login token or credential. |
| $.status | integer; {"maximum":599,"minimum":400} | Yes | — |
| $.title | string | Yes | Localized HTTP status title |
| $.type | string; {"const":"about:blank"} | Yes | — |
{
"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": 409,
"title": "Demo error",
"type": "about:blank"
}| Stable error codes |
|---|
| device_required |
| device_scope |
| incomplete_report |
| invalid_device |
| invalid_report |
| unselected_collector |
| Header | Type and limits | Meaning |
|---|---|---|
| Cache-Control | string; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"} | Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation. |
| Content-Language | string; {"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-Policy | JSON; {"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. |
| Vary | string | Responses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie. |
| X-Content-Type-Options | JSON; {"const":"nosniff"} | The browser must use the declared content type. |
| X-Frame-Options | JSON; {"const":"DENY"} | The response must not be embedded in a frame. |
| X-Request-ID | string | Server-generated request identifier. Include this when reporting an error; inbound values are not trusted. |
application/problem+json
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | Problem | Yes | — |
| $.code | string | Yes | Stable machine-readable error code |
| $.detail | string | Yes | Short localized explanation without internal error details |
| $.instance | string | Yes | Unique relative identifier /api/v1/requests/{request_id}; not a retrievable resource |
| $.message | string | Yes | Temporarily identical to detail for existing clients |
| $.message_key | string | Yes | Stable translation key for changing the displayed language without another request |
| $.message_params | object; {"additionalProperties":true} | Yes | Named, safely rendered message parameters; never arbitrary HTML |
| $.request_id | string; {"pattern":"^[0-9a-f]{32}$"} | Yes | Server-generated diagnostic identifier. It contains no login token or credential. |
| $.status | integer; {"maximum":599,"minimum":400} | Yes | — |
| $.title | string | Yes | Localized HTTP status title |
| $.type | string; {"const":"about:blank"} | Yes | — |
{
"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 |
|---|
| unavailable |
| Header | Type and limits | Meaning |
|---|---|---|
| Cache-Control | string; {"pattern":"(?:^|,\\s*)no-store(?:,|$)"} | Private API responses prohibit storage. Public OAuth metadata is cached for 300 seconds; live streams additionally prohibit transformation. |
| Content-Language | string; {"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-Policy | JSON; {"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-After | string; {"pattern":"^[0-9]+$"} | Seconds before retry. Preserve supported idempotency identifiers and respect the operation’s mutation semantics. |
| Vary | string | Responses vary by Accept-Language; browser-rendered responses can also vary by the preference cookie. |
| X-Content-Type-Options | JSON; {"const":"nosniff"} | The browser must use the declared content type. |
| X-Frame-Options | JSON; {"const":"DENY"} | The response must not be embedded in a frame. |
| X-Request-ID | string | Server-generated request identifier. Include this when reporting an error; inbound values are not trusted. |
application/problem+json
| Field | Type and limits | Required | Meaning |
|---|---|---|---|
| $ | Problem | Yes | — |
| $.code | string | Yes | Stable machine-readable error code |
| $.detail | string | Yes | Short localized explanation without internal error details |
| $.instance | string | Yes | Unique relative identifier /api/v1/requests/{request_id}; not a retrievable resource |
| $.message | string | Yes | Temporarily identical to detail for existing clients |
| $.message_key | string | Yes | Stable translation key for changing the displayed language without another request |
| $.message_params | object; {"additionalProperties":true} | Yes | Named, safely rendered message parameters; never arbitrary HTML |
| $.request_id | string; {"pattern":"^[0-9a-f]{32}$"} | Yes | Server-generated diagnostic identifier. It contains no login token or credential. |
| $.status | integer; {"maximum":599,"minimum":400} | Yes | — |
| $.title | string | Yes | Localized HTTP status title |
| $.type | string; {"const":"about:blank"} | Yes | — |
{
"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"
}Retries and asynchronous work
This change does not have a general retry guarantee. If the response is unclear, read the affected resource before trying again. Follow Retry-After waiting times and request new sign-in or action codes when they expire.
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.
curl --silent --show-error --output /dev/null --write-out "%{http_code}\n" \
--request POST \
--header @"$HOME/.config/metribeacon/headers.txt" \
--header "Content-Type: application/json" \
--data-binary '{}' \
"https://metribeacon.com/api/v1/agent/server-report"
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())
headers["Content-Type"] = "application/json"
request = Request("https://metribeacon.com/api/v1/agent/server-report", data="{}".encode("utf-8"), headers=headers, method="POST")
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()
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"));
headers["Content-Type"] = "application/json";
const response = await fetch("https://metribeacon.com/api/v1/agent/server-report", {
method: "POST", headers, redirect: "manual",
signal: AbortSignal.timeout(10000), body: "{}",
});
console.log(response.status);
await response.body?.cancel();
package main
import (
"fmt"
"net/http"
"time"
"encoding/json"
"os"
"path/filepath"
"strings"
)
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("POST", "https://metribeacon.com/api/v1/agent/server-report", strings.NewReader("{}"))
if err != nil { panic("request failed; credentials and response omitted") }
for name, value := range headers { request.Header.Set(name, value) }
request.Header.Set("Content-Type", "application/json")
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)
}
Related guides
- HTTP API, OAuth and MCP
Find the user API endpoints, their permissions, fields, examples and response formats.
- GET Read the profile assigned to the device key
The device-bound key can read only its active server monitor profile and assigned series. Capability and account admission limits still apply.
- GET Read a server-profile provisioning job
Read a server-profile provisioning job.
- POST Cancel a server-profile provisioning job
Cancels pending provisioning. Already created series and their history remain; unused pending selections release reservations.