const url = 'https://app.monitorly.cloud/api/v1/checks/CHECK_ID';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"escalationPolicyId":"ESCALATION_POLICY_ID"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://app.monitorly.cloud/api/v1/checks/CHECK_ID \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "escalationPolicyId": "ESCALATION_POLICY_ID" }'Changes only which escalation policy the check’s incidents follow: its own, or the project’s with null. An incident that is already open keeps the policy it started with. Needs the editor role; a token needs alerts:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The check’s id.
Example
CHECK_IDRequest Bodyrequired
Section titled “Request Bodyrequired”PATCH /checks/{checkId}: which escalation policy the check follows.
object
A policy of the workspace, or null for the project’s.
Example
ESCALATION_POLICY_IDResponses
Section titled “Responses”The check.
A stored check as answered by the API.
object
Bumped whenever a change alters the check’s meaning; results of other epochs never vote.
The check’s own escalation policy; null: the project’s (ProjectView.escalationPolicyId).
object
object
object
object
Header names compare case-insensitively; a missing header is the empty string.
object
One value of a JSON body, selected by a JSONPath singular query ($.data.items[0].status); value
is ignored by exists and not_exists.
object
How a JSON assertion compares the value its path selects.
Response time above this marks the run DEGRADED.
object
object
object
Every listed value must be in the answer; empty means any answer passes.
Resolver address; absent uses the node’s system resolver.
object
Days before expiry with a warning; default 14, 7 and 1.
object
Days before expiry with a warning; default 30 and 7.
object
A ping is due every period. With schedule it is not read and may be left out; answers always give
it, as the shortest gap between the schedule’s next occurrences.
object
A container that was running stopped with a non-zero exit code, was killed for lack of memory or died, or restarted 3 times within 10 minutes (the node must report Docker). Preset: on.
Any filesystem fuller than abovePercent (df’s “Use%”); a mount of mounts may have its own. Preset:
above 90 %, at once. Clears 2 points below.
object
1–99.
How long the value must stay above; 0: at once. At most 86400.
A disk busy busyPercent of the time with queue requests in flight or more. Off unless set; suggested:
95 % and 10 for 30 minutes.
object
1–100.
1–1000 requests in flight on average.
A filesystem fuller than minUsedPercent that fills within hours at the rate of the last 6 hours.
Preset: within 24 hours, above 60 %, held 1 hour.
object
1–720.
1–99: fuller filesystems only.
Names the rules leave alone, at most 50 per list; * stands for any run of characters (build-*). Sensors
are named <chip>/<label> (coretemp/Core 0) or by their chip alone.
object
Filesystems with their own disk rule, at most 32, each mount once.
One filesystem’s own disk rule: its own threshold, optionally only while less than freeBelowGb is free,
or muted (no disk, inode, forecast or read-only problem for it).
object
1–99; absent: the check’s disk threshold.
1–1000000 GB (10⁹ bytes): only while less than this is free.
An absolute mount path, for example /var/lib/docker.
A notice when the kernel kills a process for lack of memory (at most one per 30 minutes). Preset: on.
A filesystem this check saw writable turned read only. Preset: on.
A temperature sensor at its own limit (its max, else 5 °C under its critical point; one under 40 °C counts
as none), or at or above celsius when it reports no limit. Preset: 90 °C for 10 minutes. Clears 3 °C
below.
object
30–150 °C, for sensors that report no limit of their own.
A notice when a Raspberry Pi reports under-voltage. Preset: on.
A systemd unit the node reports is failed (the node must report systemd). Preset: on.
config when a config apply manages the check (only those are pruned), ui otherwise. Always sent;
optional in the schema because it was added after the first clients.
The check’s key in a config file (monitorly.yaml); null until a config apply creates or adopts it.
Always sent; optional in the schema because it was added after the first clients.
Example
{ "escalationPolicyId": "ESCALATION_POLICY_ID", "id": "ID", "kind": { "assertions": [ { "op": "eq", "target": "status" } ], "headers": [ { "value": { "kind": "plain" } } ], "method": "GET", "type": "http" }, "managedBy": "ui", "nodes": [ "ID" ], "projectId": "PROJECT_ID", "quorum": { "mode": "half" }}Bad Request.
request.malformed: the body or a parameter is not of the expected shapeauth.credentials_conflict: the request carries both a session cookie and a token
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unauthorized.
auth.unauthenticated,auth.session_expired: no session, or it endedtoken.invalid: the token is malformed, unknown, revoked or expired, or its creator left the workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Forbidden.
auth.forbidden: your role is too low for thistoken.scope_missing: the token lacks the scope this needs;detailnames itrequest.origin_mismatch,request.header_required: a changing request with a session comes from another site or lacksX-Monitorly-Request: 1
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Not Found.
request.not_found: it does not exist, or you cannot see it
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Payload Too Large.
request.too_large: the body is larger than 256 KiB
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Unprocessable Entity.
field.required,field.too_long,field.invalid: a field breaks a rule;errorspoints at itescalation_policy.unknown:escalationPolicyIdis not a policy of this workspace
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Too Many Requests.
token.rate_limited: more than 10 requests a second with this tokensession.rate_limited: more than 5 changes a second from your sessions
object
Field errors, empty for errors of the whole request.
object
object
JSON pointer into the request body.
Stable code, for example check.timeout_exceeds_interval.
Example generated
{ "detail": "example", "errors": [ { "code": "example", "params": { "additionalProperty": "example" }, "pointer": "example" } ], "status": 1, "title": "example", "type": "example"}Headers
Section titled “Headers”Seconds to wait before trying again.