MetriBeacon
Menu

POST Read local chart previews in a batch

/api/v1/devices/{id}/chart-previews

Read up to 16 numeric or state series belonging to this monitor for one time window. Each result is complete locally or indicates that a separate history query is needed. Local previews cover at most 24 hours and 1,000 display points per series; the response is limited to 4 MiB. Read permissions are sufficient. No archive jobs are created by this request.

On this page

Access and permissions

Read up to 16 numeric or state series belonging to this monitor for one time window. Each result is complete locally or indicates that a separate history query is needed. Local previews cover at most 24 hours and 1,000 display points per series; the response is limited to 4 MiB. Read permissions are sufficient. No archive jobs are created by this request.

Browser session: __Host-mb_session cookie.

Machine management credentials in Authorization: Bearer. Check the permissions (scopes) required by the operation.

When using a browser session for a mutation, send the current CSRF token in X-CSRF-Token with the same-site cookie. OAuth consent uses its documented form field.

Parameters and headers

FieldLocationType and limitsRequiredMeaning
idPathstring; {"format":"uuid"}YesResource UUID from the path. It must exist and be accessible to the acting identity.
OriginHeaderstring; {"format":"uri"}NoIf present, must match the canonical HTTPS origin. Sec-Fetch-Site cross-site is rejected.
X-CSRF-TokenHeaderstringNoBrowser CSRF cookie value. Not required when an allowed machine management credential is used.

Request body

FieldType and limitsRequiredMeaning
$object; {"additionalProperties":false}Yes—
$.fromstring; {"format":"date-time"}YesInclusive start of the requested UTC range in RFC 3339.
$.tostring; {"format":"date-time"}YesExclusive end of the requested UTC range in RFC 3339. It must be later than from.
$.resolutionstring; {"default":"auto","enum":["auto","raw","minute","quarter_hour","hour"]}NoRequested data resolution. Aggregates summarize a bucket and do not reconstruct every original observation.
$.series_idsarray<string; {"format":"uuid"}>; {"minItems":1,"maxItems":16}YesOne to sixteen distinct series IDs belonging to this monitor.
$.series_ids[]string; {"format":"uuid"}Yes—

Responses

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/json

FieldType and limitsRequiredMeaning
$objectYes—
$.snapshotstring; {"format":"date-time"}Yes—
$.resultsarray<object>; {"maxItems":16}YesLocal history results or a fallback indication for each requested series.
$.results[]objectYes—
$.results[].series_idstring; {"format":"uuid"}Yes—
$.results[].statusstring; {"enum":["complete","fallback"]}Yes—
$.results[].resultHistoryResultNo—
$.results[].result.completenessstringYes—
$.results[].result.display_secondsintegerYes—
$.results[].result.gapsarray<object>Yes—
$.results[].result.gaps[]objectYes—
$.results[].result.gaps[].fromstring; {"format":"date-time"}YesInclusive start of the requested UTC range in RFC 3339.
$.results[].result.gaps[].reasonstringYesShort explanation for the selected maintenance or attention condition.
$.results[].result.gaps[].tostring; {"format":"date-time"}YesExclusive end of the requested UTC range in RFC 3339. It must be later than from.
$.results[].result.kindstringYesResource kind or measurement type selected from the listed values.
$.results[].result.namestringYesHuman-readable resource name. Follow the listed length limit.
$.results[].result.next_cursorstringNoCursor for the next page; null or empty, as specified by the schema, means the current list has ended.
$.results[].result.pointsarray<object>Yes—
$.results[].result.points[]objectYes—
$.results[].result.points[].countintegerNoNumber of observations or resources represented by this item.
$.results[].result.points[].counter_epochstringNo—
$.results[].result.points[].counter_increasenumber | nullNoCounter increase accumulated across accepted adjacent readings; null where it does not apply.
$.results[].result.points[].counter_increase (anyOf 1)numberNo—
$.results[].result.points[].counter_increase (anyOf 2)nullNo—
$.results[].result.points[].counter_resetsinteger | nullNoNumber of detected counter resets in the aggregate; null where it does not apply.
$.results[].result.points[].counter_resets (anyOf 1)integerNo—
$.results[].result.points[].counter_resets (anyOf 2)nullNo—
$.results[].result.points[].first_counter_epochstringNo—
$.results[].result.points[].lastnumberYesLast accepted numeric value in the bucket.
$.results[].result.points[].last_atstring; {"format":"date-time"}YesTimestamp of the last accepted observation in the bucket.
$.results[].result.points[].maxnumberYesMaximum observed numeric value in the bucket.
$.results[].result.points[].meannumberYesArithmetic mean of accepted observations in the bucket; it is not a time-weighted interpolation.
$.results[].result.points[].minnumberYesMinimum observed numeric value in the bucket.
$.results[].result.points[].point_idstringNo—
$.results[].result.points[].source_received_untilstring; {"format":"date-time"}YesSource-receipt watermark used for aggregate completeness.
$.results[].result.points[].state_valuestring | nullNo—
$.results[].result.points[].state_value (anyOf 1)stringNo—
$.results[].result.points[].state_value (anyOf 2)nullNo—
$.results[].result.points[].statesobjectNo—
$.results[].result.points[].sumnumberNoSum of accepted numeric observations in the bucket.
$.results[].result.points[].timestring; {"format":"date-time"}YesObservation timestamp or aggregate bucket start in UTC, according to the selected resolution.
$.results[].result.points[].valuenumber | nullNo—
$.results[].result.points[].value (anyOf 1)numberNo—
$.results[].result.points[].value (anyOf 2)nullNo—
$.results[].result.points[].row_keystringNoStable category key for a state aggregate table row; raw point_id remains the original point UUID.
$.results[].result.points[].valid_untilstring; {"format":"date-time"}No—
$.results[].result.resolutionstringYesRequested data resolution. Aggregates summarize a bucket and do not reconstruct every original observation.
$.results[].result.series_idstringYesUUID of the measurement series belonging to the authorized device.
$.results[].result.snapshotstring; {"format":"date-time"}Yes—
$.results[].result.sourcestringYesSource of the returned data or diagnostic record.
$.results[].result.truncatedbooleanYesTrue when the bounded response omits additional entries. Narrow the range or use the documented job or pagination flow.
$.results[].result.unitstringYesDisplay unit for a numeric series; it does not automatically convert submitted values.
$.results[].result.validity_secondsintegerNo—
$.results[].result.state_beforeobjectNoFor raw state charts, the last accepted state before the requested start, limited by retention and state validity. It is context only and is not included in the original rows or pagination.
$.results[].result.state_before.timestring; {"format":"date-time"}Yes—
$.results[].result.state_before.point_idstringNo—
$.results[].result.state_before.state_valuestringYes—
$.results[].result.state_before.valid_untilstring; {"format":"date-time"}No—
json
{
  "snapshot": "2026-09-30T12:00:00Z",
  "results": [
    {
      "series_id": "11111111-1111-4111-8111-111111111111",
      "status": "complete",
      "result": {
        "completeness": "complete",
        "display_seconds": 60,
        "gaps": [],
        "kind": "gauge",
        "name": "Synthetic CPU",
        "points": [],
        "resolution": "minute",
        "series_id": "11111111-1111-4111-8111-111111111111",
        "snapshot": "2026-09-30T12:00:00Z",
        "source": "local",
        "truncated": false,
        "unit": "%"
      }
    }
  ]
}
Stable error codes
invalid_credential
unauthorized
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
csrf
insufficient_scope
invalid_origin
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
invalid_cursor
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_cursor
invalid_kind
invalid_query
invalid_resolution
invalid_filters
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
query_limit
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": 429,
  "title": "Demo error",
  "type": "about:blank"
}
Stable error codes
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"
}

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 POST \
  --header @"$HOME/.config/metribeacon/headers.txt" \
  --header "Content-Type: application/json" \
  --data-binary '{"series_ids":["11111111-1111-4111-8111-111111111111"],"from":"2026-09-30T06:00:00Z","to":"2026-09-30T12:00:00Z","resolution":"auto"}' \
  "https://metribeacon.com/api/v1/devices/00000000-0000-4000-8000-000000000001/chart-previews"
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())
headers["Content-Type"] = "application/json"
request = Request("https://metribeacon.com/api/v1/devices/00000000-0000-4000-8000-000000000001/chart-previews", data="{\"series_ids\":[\"11111111-1111-4111-8111-111111111111\"],\"from\":\"2026-09-30T06:00:00Z\",\"to\":\"2026-09-30T12:00:00Z\",\"resolution\":\"auto\"}".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()
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"));
headers["Content-Type"] = "application/json";
const response = await fetch("https://metribeacon.com/api/v1/devices/00000000-0000-4000-8000-000000000001/chart-previews", {
  method: "POST", headers, redirect: "manual",
  signal: AbortSignal.timeout(10000), body: "{\"series_ids\":[\"11111111-1111-4111-8111-111111111111\"],\"from\":\"2026-09-30T06:00:00Z\",\"to\":\"2026-09-30T12:00:00Z\",\"resolution\":\"auto\"}",
});
console.log(response.status);
await response.body?.cancel();
go
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/devices/00000000-0000-4000-8000-000000000001/chart-previews", strings.NewReader("{\"series_ids\":[\"11111111-1111-4111-8111-111111111111\"],\"from\":\"2026-09-30T06:00:00Z\",\"to\":\"2026-09-30T12:00:00Z\",\"resolution\":\"auto\"}"))
  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)
}