Menu
API reference
Metrics
Custom metrics extracted from a monitor's responses, and their readings.
- GET List a monitor's metrics
- POST Create a metric
- POST Preview a metric rule
- POST Discover metrics with AI
- PATCH Reorder metrics
- PUT Update a metric
- DELETE Delete a metric
- GET Get recent samples of every metric
- GET Get a metric series
- GET List a metric's readings
List a monitor's metrics
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
Response 200 application/json
dataarray of MonitorMetricResource requiredidstring requiredmonitor_idstring requiredgroup_namestring or null requiredlabelstring requiredkeystring requiredtypestring, one of "numeric", "status", "string" requiredsourcestring or null, one of "json_path", "regex", "xpath", "header", "http_status", null requiredextraction_pathstring or null requiredunitstring or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null requiredthreshold_directionstring or null, one of "high_bad", "low_bad", null requiredwarn_boundnumber or null requiredcritical_boundnumber or null requiredok_valuesarray of any requiredThe string values that band as ok for a string metric.
warn_valuesarray of any requiredcritical_valuesarray of any requiredunmatched_bandstring or null, one of "ok", "warn", "critical", null requiredanomaly_enabledboolean requiredanomaly_directionstring, one of "high_bad", "low_bad", "both" requiredanomaly_kindstring, one of "gauge", "counter", "count_per_period" requiredanomaly_sensitivitystring, one of "low", "medium", "high" requireddisplay_orderinteger requiredlatestobject or nullrecorded_atstring or null requirednumeric_valuenumber or null requiredstring_valuestring requiredstatus_valuestring or null requiredbandstring 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())
Try it
ms
Create a metric
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| Idempotency-Key | header | string | No | Any unique string per logical request. |
Request body application/json
group_namestring or null, max length 80labelstring, max length 120 requiredtypeMetricType: string, one of "numeric", "status", "string" requiredClassification of a custom monitor metric.
sourceMetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" or nullextraction_pathstring or null, max length 500unitMetricUnit: string, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom" or nullthreshold_directionThresholdDirection: string, one of "high_bad", "low_bad" or nullwarn_boundnumber or nullcritical_boundnumber or nulldisplay_orderinteger or null, min 0anomaly_enabledbooleananomaly_directionMetricAnomalyDirection: string, one of "high_bad", "low_bad", "both"Which side of a baseline counts as an anomaly: high_bad, low_bad or both.
anomaly_kindMetricKind: string, one of "gauge", "counter", "count_per_period"What a numeric metric's readings measure, which decides how the sweep reads them.
anomaly_sensitivityAnomalySensitivity: string, one of "low", "medium", "high"How far from its baseline a metric has to move before the sweep reports it.
ok_valuesarray of string, min length 1, max length 120, max items 50warn_valuesarray of string, min length 1, max length 120, max items 50critical_valuesarray of string, min length 1, max length 120, max items 50unmatched_bandMetricBand: string, one of "ok", "warn", "critical" or nullkeystring, max length 40 required
Response 201 application/json
dataMonitorMetricResource requiredidstring requiredmonitor_idstring requiredgroup_namestring or null requiredlabelstring requiredkeystring requiredtypestring, one of "numeric", "status", "string" requiredsourcestring or null, one of "json_path", "regex", "xpath", "header", "http_status", null requiredextraction_pathstring or null requiredunitstring or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null requiredthreshold_directionstring or null, one of "high_bad", "low_bad", null requiredwarn_boundnumber or null requiredcritical_boundnumber or null requiredok_valuesarray of any requiredThe string values that band as ok for a string metric.
warn_valuesarray of any requiredcritical_valuesarray of any requiredunmatched_bandstring or null, one of "ok", "warn", "critical", null requiredanomaly_enabledboolean requiredanomaly_directionstring, one of "high_bad", "low_bad", "both" requiredanomaly_kindstring, one of "gauge", "counter", "count_per_period" requiredanomaly_sensitivitystring, one of "low", "medium", "high" requireddisplay_orderinteger requiredlatestobject or nullrecorded_atstring or null requirednumeric_valuenumber or null requiredstring_valuestring requiredstatus_valuestring or null requiredbandstring 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())
Try it
ms
Preview a metric rule
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| Idempotency-Key | header | string | No | Any unique string per logical request. |
Request body application/json
sourceMetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" requiredExtraction strategy used to pull a metric value out of a check response.
extraction_pathstring or null, max length 500typeMetricType: string, one of "numeric", "status", "string" requiredClassification of a custom monitor metric.
sample_bodystring or nullsample_headersarray of string or nullsample_status_codeinteger or nullthreshold_directionThresholdDirection: string, one of "high_bad", "low_bad" or nullwarn_boundnumber or nullcritical_boundnumber or nullok_valuesarray of string, min length 1, max length 120, max items 50warn_valuesarray of string, min length 1, max length 120, max items 50critical_valuesarray of string, min length 1, max length 120, max items 50unmatched_bandMetricBand: string, one of "ok", "warn", "critical" or null
Response 200 application/json
extracted_valuestring or null requiredtype_validboolean requirederrorstring or null requiredbandstring or null, one of "ok", "warn", "critical", null requiredhas_sampleboolean requiredWhich sample produced this answer, so the UI can name it instead of implying it just fetched the endpoint live.
sample_checked_atstring or null requiredsample_status_codestring 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())
Try it
ms
Discover metrics with AI
POST /monitors/{monitor}/metrics.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| Idempotency-Key | header | string | No | Any unique string per logical request. |
Response 200 application/json
dataobject requiredsuggested_metricsarray, 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())
Try it
ms
Reorder metrics
display_order for a set of the monitor's metrics.Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
Request body application/json
orderarray of object requiredidstring requireddisplay_orderinteger, 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)
Try it
ms
Update a metric
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| metric | path | string | Yes | The metric ID |
Request body application/json
group_namestring or null, max length 80labelstring, max length 120typeMetricType: string, one of "numeric", "status", "string"Classification of a custom monitor metric.
sourceMetricSource: string, one of "json_path", "regex", "xpath", "header", "http_status" or nullextraction_pathstring or null, max length 500unitMetricUnit: string, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom" or nullthreshold_directionThresholdDirection: string, one of "high_bad", "low_bad" or nullwarn_boundnumber or nullcritical_boundnumber or nulldisplay_orderinteger or null, min 0anomaly_enabledbooleananomaly_directionMetricAnomalyDirection: string, one of "high_bad", "low_bad", "both"Which side of a baseline counts as an anomaly: high_bad, low_bad or both.
anomaly_kindMetricKind: string, one of "gauge", "counter", "count_per_period"What a numeric metric's readings measure, which decides how the sweep reads them.
anomaly_sensitivityAnomalySensitivity: string, one of "low", "medium", "high"How far from its baseline a metric has to move before the sweep reports it.
ok_valuesarray of string, min length 1, max length 120, max items 50warn_valuesarray of string, min length 1, max length 120, max items 50critical_valuesarray of string, min length 1, max length 120, max items 50unmatched_bandMetricBand: string, one of "ok", "warn", "critical" or nullkeystring, max length 40
Response 200 application/json
dataMonitorMetricResource requiredidstring requiredmonitor_idstring requiredgroup_namestring or null requiredlabelstring requiredkeystring requiredtypestring, one of "numeric", "status", "string" requiredsourcestring or null, one of "json_path", "regex", "xpath", "header", "http_status", null requiredextraction_pathstring or null requiredunitstring or null, one of "bytes_auto", "byte", "kilobyte", "megabyte", "gigabyte", "terabyte", "duration_auto", "millisecond", "second", "minute", "hour", "percent", "ratio", "count", "count_short", "custom", null requiredthreshold_directionstring or null, one of "high_bad", "low_bad", null requiredwarn_boundnumber or null requiredcritical_boundnumber or null requiredok_valuesarray of any requiredThe string values that band as ok for a string metric.
warn_valuesarray of any requiredcritical_valuesarray of any requiredunmatched_bandstring or null, one of "ok", "warn", "critical", null requiredanomaly_enabledboolean requiredanomaly_directionstring, one of "high_bad", "low_bad", "both" requiredanomaly_kindstring, one of "gauge", "counter", "count_per_period" requiredanomaly_sensitivitystring, one of "low", "medium", "high" requireddisplay_orderinteger requiredlatestobject or nullrecorded_atstring or null requirednumeric_valuenumber or null requiredstring_valuestring requiredstatus_valuestring or null requiredbandstring 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())
Try it
ms
Delete a metric
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| metric | path | string | Yes | The 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)
Try it
ms
Get recent samples of every metric
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
Response 200 application/json
datastring requiredmetaobject requiredrangestring requiredlimitany 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())
Try it
ms
Get a metric series
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| metric | path | string | Yes | The metric ID |
Response 200 application/json
dataarray of object requiredrecorded_atstring requirednumeric_valuenumber or null requiredstring_valuestring or null requiredstatus_valuestring or null requiredbandstring 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())
Try it
ms
List a metric's readings
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| monitor | path | string | Yes | The monitor ID |
| metric | path | string | Yes | The metric ID |
| per_page | query | integer, min 1, max 200 | No | Page size, clamped to 1 and the endpoint's maximum (200 on most lists). |
| cursor | query | string | No | The meta.next_cursor of the previous page. |
Response 200 application/json
dataarray of MonitorMetricValueResource requiredidstring requiredrecorded_atstring requirednumeric_valuenumber or null requiredstring_valuestring or null requiredstatus_valuestring or null, one of "up", "down", "degraded", "paused", "maintenance", null requiredbandstring or null, one of "ok", "warn", "critical", null required
linksobject requiredfirststring or null requiredlaststring or null requiredprevstring or null requirednextstring or null required
metaobject requiredpathstring or null requiredBase path for paginator generated URLs.
per_pageinteger, min 0 requiredNumber of items shown per page.
next_cursorstring or null requiredThe "cursor" that points to the next set of items.
prev_cursorstring or null requiredThe "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())
Try it
ms