Skip to content
Uptizm
Start free
Sign in

Language

Menu
View as Markdown

API reference

Metrics

Custom metrics extracted from a monitor's responses, and their readings.

GET /monitors/{monitor}/metrics metrics:read #

List a monitor's metrics

The custom metrics defined on the monitor, in display order.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID

Response 200 application/json

  • data array of MonitorMetricResource required
    • id string required
    • monitor_id string required
    • group_name string or null required
    • label string required
    • key string required
    • type string, one of "numeric", "status", "string" required
    • source string or null, one of "json_path", "regex", "xpath", "header", "http_status", null required
    • extraction_path string or null required
    • unit string or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null required
    • threshold_direction string or null, one of "high_bad", "low_bad", null required
    • warn_bound number or null required
    • critical_bound number or null required
    • ok_values array of any required

      The string values that band as ok for a string metric.

    • warn_values array of any required
    • critical_values array of any required
    • unmatched_band string or null, one of "ok", "warn", "critical", null required
    • anomaly_enabled boolean required
    • anomaly_direction string, one of "high_bad", "low_bad", "both" required
    • anomaly_kind string, one of "gauge", "counter", "count_per_period" required
    • anomaly_sensitivity string, one of "low", "medium", "high" required
    • display_order integer required
    • latest object or null
      • recorded_at string or null required
      • numeric_value number or null required
      • string_value string required
      • status_value string or null required
      • band string or null required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X GET "https://api.uptizm.com/v1/monitors/MONITOR/metrics" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
  },
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
import os

import requests

response = requests.get(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
    },
)

print(response.json())
POST /monitors/{monitor}/metrics metrics:write #

Create a metric

Defines a custom metric that extracts a value from every check response of the monitor (JSONPath, regex, XPath, a header or the status code), with optional thresholds.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
Idempotency-KeyheaderstringNoAny unique string per logical request.

Request body application/json

  • group_name string or null, max length 80
  • label string, max length 120 required
  • type MetricType: string, one of "numeric", "status", "string" required

    Classification of a custom monitor metric.

  • source MetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" or null
  • extraction_path string or null, max length 500
  • unit MetricUnit: string, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom" or null
  • threshold_direction ThresholdDirection: string, one of "high_bad", "low_bad" or null
  • warn_bound number or null
  • critical_bound number or null
  • display_order integer or null, min 0
  • anomaly_enabled boolean
  • anomaly_direction MetricAnomalyDirection: string, one of "high_bad", "low_bad", "both"

    Which side of a baseline counts as an anomaly: high_bad, low_bad or both.

  • anomaly_kind MetricKind: string, one of "gauge", "counter", "count_per_period"

    What a numeric metric's readings measure, which decides how the sweep reads them.

  • anomaly_sensitivity AnomalySensitivity: string, one of "low", "medium", "high"

    How far from its baseline a metric has to move before the sweep reports it.

  • ok_values array of string, min length 1, max length 120, max items 50
  • warn_values array of string, min length 1, max length 120, max items 50
  • critical_values array of string, min length 1, max length 120, max items 50
  • unmatched_band MetricBand: string, one of "ok", "warn", "critical" or null
  • key string, max length 40 required

Response 201 application/json

  • data MonitorMetricResource required
    • id string required
    • monitor_id string required
    • group_name string or null required
    • label string required
    • key string required
    • type string, one of "numeric", "status", "string" required
    • source string or null, one of "json_path", "regex", "xpath", "header", "http_status", null required
    • extraction_path string or null required
    • unit string or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null required
    • threshold_direction string or null, one of "high_bad", "low_bad", null required
    • warn_bound number or null required
    • critical_bound number or null required
    • ok_values array of any required

      The string values that band as ok for a string metric.

    • warn_values array of any required
    • critical_values array of any required
    • unmatched_band string or null, one of "ok", "warn", "critical", null required
    • anomaly_enabled boolean required
    • anomaly_direction string, one of "high_bad", "low_bad", "both" required
    • anomaly_kind string, one of "gauge", "counter", "count_per_period" required
    • anomaly_sensitivity string, one of "low", "medium", "high" required
    • display_order integer required
    • latest object or null
      • recorded_at string or null required
      • numeric_value number or null required
      • string_value string required
      • status_value string or null required
      • band string or null required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 422 Validation error
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X POST "https://api.uptizm.com/v1/monitors/MONITOR/metrics" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "label": "string",
    "type": "numeric",
    "key": "string"
}'
const payload = {
    "label": "string",
    "type": "numeric",
    "key": "string"
};

const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify(payload),
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics');

$payload = <<<'JSON'
{
    "label": "string",
    "type": "numeric",
    "key": "string"
}
JSON;

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
        'Idempotency-Key: '.uniqid('', true),
    ],
    CURLOPT_POSTFIELDS => $payload,
]);

$response = curl_exec($curl);
import os
import uuid

import requests

response = requests.post(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    data=r'''{
    "label": "string",
    "type": "numeric",
    "key": "string"
}''',
)

print(response.json())
POST /monitors/{monitor}/metrics/preview metrics:write #

Preview a metric rule

Runs a draft extraction rule against the monitor's newest archived response and returns the extracted value and the threshold band it would land in. Stores nothing.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
Idempotency-KeyheaderstringNoAny unique string per logical request.

Request body application/json

  • source MetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" required

    Extraction strategy used to pull a metric value out of a check response.

  • extraction_path string or null, max length 500
  • type MetricType: string, one of "numeric", "status", "string" required

    Classification of a custom monitor metric.

  • sample_body string or null
  • sample_headers array of string or null
  • sample_status_code integer or null
  • threshold_direction ThresholdDirection: string, one of "high_bad", "low_bad" or null
  • warn_bound number or null
  • critical_bound number or null
  • ok_values array of string, min length 1, max length 120, max items 50
  • warn_values array of string, min length 1, max length 120, max items 50
  • critical_values array of string, min length 1, max length 120, max items 50
  • unmatched_band MetricBand: string, one of "ok", "warn", "critical" or null

Response 200 application/json

  • extracted_value string or null required
  • type_valid boolean required
  • error string or null required
  • band string or null, one of "ok", "warn", "critical", null required
  • has_sample boolean required

    Which sample produced this answer, so the UI can name it instead of implying it just fetched the endpoint live.

  • sample_checked_at string or null required
  • sample_status_code string or integer or null required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 422 Validation error
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X POST "https://api.uptizm.com/v1/monitors/MONITOR/metrics/preview" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "source": "json_path",
    "type": "numeric"
}'
const payload = {
    "source": "json_path",
    "type": "numeric"
};

const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/preview', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify(payload),
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/preview');

$payload = <<<'JSON'
{
    "source": "json_path",
    "type": "numeric"
}
JSON;

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
        'Idempotency-Key: '.uniqid('', true),
    ],
    CURLOPT_POSTFIELDS => $payload,
]);

$response = curl_exec($curl);
import os
import uuid

import requests

response = requests.post(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/preview",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    data=r'''{
    "source": "json_path",
    "type": "numeric"
}''',
)

print(response.json())
POST /monitors/{monitor}/metrics/discover metrics:write #

Discover metrics with AI

Proposes metrics worth adding, read from the monitor's newest archived content. Stores nothing; create the ones you want with POST /monitors/{monitor}/metrics.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
Idempotency-KeyheaderstringNoAny unique string per logical request.

Response 200 application/json

  • data object required
    • suggested_metrics array, max items 2 or array, max items 2 or array of string, max items 0 required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X POST "https://api.uptizm.com/v1/monitors/MONITOR/metrics/discover" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json" \
  -H "Idempotency-Key: $(uuidgen)"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/discover', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/discover');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
        'Idempotency-Key: '.uniqid('', true),
    ],
]);

$response = curl_exec($curl);
import os
import uuid

import requests

response = requests.post(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/discover",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)

print(response.json())
PATCH /monitors/{monitor}/metrics/reorder metrics:write #

Reorder metrics

Sets display_order for a set of the monitor's metrics.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID

Request body application/json

  • order array of object required
    • id string required
    • display_order integer, min 0 required

Response 204

No body.

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 422 Validation error
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X PATCH "https://api.uptizm.com/v1/monitors/MONITOR/metrics/reorder" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "order": [
        {
            "id": "string",
            "display_order": 0
        }
    ]
}'
const payload = {
    "order": [
        {
            "id": "string",
            "display_order": 0
        }
    ]
};

const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/reorder', {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(payload),
});

console.log(response.status);
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/reorder');

$payload = <<<'JSON'
{
    "order": [
        {
            "id": "string",
            "display_order": 0
        }
    ]
}
JSON;

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $payload,
]);

$response = curl_exec($curl);
import os

import requests

response = requests.patch(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/reorder",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    data=r'''{
    "order": [
        {
            "id": "string",
            "display_order": 0
        }
    ]
}''',
)

print(response.status_code)
PUT /monitors/{monitor}/metrics/{metric} metrics:write #

Update a metric

Edits one metric definition; only the fields sent change.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
metricpathstringYesThe metric ID

Request body application/json

  • group_name string or null, max length 80
  • label string, max length 120
  • type MetricType: string, one of "numeric", "status", "string"

    Classification of a custom monitor metric.

  • source MetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" or null
  • extraction_path string or null, max length 500
  • unit MetricUnit: string, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom" or null
  • threshold_direction ThresholdDirection: string, one of "high_bad", "low_bad" or null
  • warn_bound number or null
  • critical_bound number or null
  • display_order integer or null, min 0
  • anomaly_enabled boolean
  • anomaly_direction MetricAnomalyDirection: string, one of "high_bad", "low_bad", "both"

    Which side of a baseline counts as an anomaly: high_bad, low_bad or both.

  • anomaly_kind MetricKind: string, one of "gauge", "counter", "count_per_period"

    What a numeric metric's readings measure, which decides how the sweep reads them.

  • anomaly_sensitivity AnomalySensitivity: string, one of "low", "medium", "high"

    How far from its baseline a metric has to move before the sweep reports it.

  • ok_values array of string, min length 1, max length 120, max items 50
  • warn_values array of string, min length 1, max length 120, max items 50
  • critical_values array of string, min length 1, max length 120, max items 50
  • unmatched_band MetricBand: string, one of "ok", "warn", "critical" or null
  • key string, max length 40

Response 200 application/json

  • data MonitorMetricResource required
    • id string required
    • monitor_id string required
    • group_name string or null required
    • label string required
    • key string required
    • type string, one of "numeric", "status", "string" required
    • source string or null, one of "json_path", "regex", "xpath", "header", "http_status", null required
    • extraction_path string or null required
    • unit string or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null required
    • threshold_direction string or null, one of "high_bad", "low_bad", null required
    • warn_bound number or null required
    • critical_bound number or null required
    • ok_values array of any required

      The string values that band as ok for a string metric.

    • warn_values array of any required
    • critical_values array of any required
    • unmatched_band string or null, one of "ok", "warn", "critical", null required
    • anomaly_enabled boolean required
    • anomaly_direction string, one of "high_bad", "low_bad", "both" required
    • anomaly_kind string, one of "gauge", "counter", "count_per_period" required
    • anomaly_sensitivity string, one of "low", "medium", "high" required
    • display_order integer required
    • latest object or null
      • recorded_at string or null required
      • numeric_value number or null required
      • string_value string required
      • status_value string or null required
      • band string or null required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 422 Validation error
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X PUT "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{}'
const payload = {};

const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC', {
  method: 'PUT',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(payload),
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC');

$payload = <<<'JSON'
{}
JSON;

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $payload,
]);

$response = curl_exec($curl);
import os

import requests

response = requests.put(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    data=r'''{}''',
)

print(response.json())
DELETE /monitors/{monitor}/metrics/{metric} metrics:write #

Delete a metric

Deletes the metric and its readings.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
metricpathstringYesThe metric ID

Response 204

No body.

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X DELETE "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC', {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
  },
});

console.log(response.status);
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
import os

import requests

response = requests.delete(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
    },
)

print(response.status_code)
GET /monitors/{monitor}/metrics/series metrics:read #

Get recent samples of every metric

The most recent samples of every metric on the monitor in one response.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID

Response 200 application/json

  • data string required
  • meta object required
    • range string required
    • limit any required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X GET "https://api.uptizm.com/v1/monitors/MONITOR/metrics/series" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/series', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
  },
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/series');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
import os

import requests

response = requests.get(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/series",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
    },
)

print(response.json())
GET /monitors/{monitor}/metrics/{metric}/series metrics:read #

Get a metric series

One metric's readings over the requested window, oldest first, for charting. Beyond 24 hours a numeric metric comes back as bucket averages.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
metricpathstringYesThe metric ID

Response 200 application/json

  • data array of object required
    • recorded_at string required
    • numeric_value number or null required
    • string_value string or null required
    • status_value string or null required
    • band string or null required

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X GET "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/series" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/series', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
  },
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/series');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
import os

import requests

response = requests.get(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/series",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
    },
)

print(response.json())
GET /monitors/{monitor}/metrics/{metric}/readings metrics:read #

List a metric's readings

One metric's readings, newest first, cursor-paginated.

Parameters

NameInTypeRequiredDescription
monitorpathstringYesThe monitor ID
metricpathstringYesThe metric ID
per_pagequeryinteger, min 1, max 200NoPage size, clamped to 1 and the endpoint's maximum (200 on most lists).
cursorquerystringNoThe meta.next_cursor of the previous page.

Response 200 application/json

  • data array of MonitorMetricValueResource required
    • id string required
    • recorded_at string required
    • numeric_value number or null required
    • string_value string or null required
    • status_value string or null, one of "up", "down", "degraded", "paused", "maintenance", null required
    • band string or null, one of "ok", "warn", "critical", null required
  • links object required
    • first string or null required
    • last string or null required
    • prev string or null required
    • next string or null required
  • meta object required
    • path string or null required

      Base path for paginator generated URLs.

    • per_page integer, min 0 required

      Number of items shown per page.

    • next_cursor string or null required

      The "cursor" that points to the next set of items.

    • prev_cursor string or null required

      The "cursor" that points to the previous set of items.

Errors

  • 401 Unauthenticated
  • 403 The key lacks the ability this endpoint requires (required_ability names it), or the action is not allowed for the team.
  • 404 Not found
  • 429 Rate limited. Each key may make 120 reads (GET) and 30 writes per minute; wait for Retry-After seconds.

Code samples

curl -X GET "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/readings" \
  -H "Authorization: Bearer $UPTIZM_API_KEY" \
  -H "Accept: application/json"
const response = await fetch('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/readings', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.UPTIZM_API_KEY}`,
    'Accept': 'application/json',
  },
});

const data = await response.json();
<?php

$curl = curl_init('https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/readings');

curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer '.getenv('UPTIZM_API_KEY'),
        'Accept: application/json',
    ],
]);

$response = curl_exec($curl);
import os

import requests

response = requests.get(
    "https://api.uptizm.com/v1/monitors/MONITOR/metrics/METRIC/readings",
    headers={
        "Authorization": "Bearer " + os.environ["UPTIZM_API_KEY"],
        "Accept": "application/json",
    },
)

print(response.json())

Type to search the guides, resources and endpoints.