Update a monitor
const url = 'https://api.perstat.io/monitors/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"alarm_gate":{"grace_seconds":1,"origins":["example"]},"config":"example","enabled":true,"interval_seconds":1,"name":"example","policy":{"alarm_consecutive":1,"alarm_min_duration_seconds":1,"alarm_quorum_mode":"example","alarm_quorum_value":1,"alert_profile_id":"example","effective_alarm":{"alarm_consecutive":1,"alarm_min_duration_seconds":1,"alarm_quorum_mode":"example","alarm_quorum_value":1,"source":"example"},"failed_interval_seconds":1,"recovery_consecutive":1,"recovery_quorum_mode":"example","recovery_quorum_value":1},"regions":["example"],"type":"example"}'};
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://api.perstat.io/monitors/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "alarm_gate": { "grace_seconds": 1, "origins": [ "example" ] }, "config": "example", "enabled": true, "interval_seconds": 1, "name": "example", "policy": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "alert_profile_id": "example", "effective_alarm": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "source": "example" }, "failed_interval_seconds": 1, "recovery_consecutive": 1, "recovery_quorum_mode": "example", "recovery_quorum_value": 1 }, "regions": [ "example" ], "type": "example" }'Partially updates a monitor: name, type, configuration, check interval, probe regions, confirmation policy, and the enabled flag. Omitted fields keep their current value; the same interval and region rules as on create apply. Disabling a monitor also resolves its open incidents and ends running escalations, since a paused monitor can no longer confirm recovery. An archived monitor is not changed: the update returns 409 with the error code monitor_archived; restore it first with POST /monitors/{monitor_id}/restore. Refused fields return 400 (402 for too many regions) with the same error body as on create. Requires project management rights. Accepts API keys with the monitors:write scope, subject to current role and resource grants.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Abhaengige Alarme. Weggelassen = unveraendert, null = Regel entfernen.
object
Spaetestens so viele Sekunden nach Beginn wird laut alarmiert.
Ursprungs-Dienste (public_ids). Ist EINER belegt unten, wird gehalten.
Confirmation-Policy (Alarmprofil oder Inline). Weggelassen = unverändert.
object
Legacy per-monitor duration. A configured organization flow is the canonical effective source.
Examplegenerated
{ "alarm_gate": { "grace_seconds": 1, "origins": [ "example" ] }, "config": "example", "enabled": true, "interval_seconds": 1, "name": "example", "policy": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "alert_profile_id": "example", "effective_alarm": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "source": "example" }, "failed_interval_seconds": 1, "recovery_consecutive": 1, "recovery_quorum_mode": "example", "recovery_quorum_value": 1 }, "regions": [ "example" ], "type": "example"}Responses
Section titled “Responses”Request succeeded. The response body contains the result.
object
true while the monitor is archived: it runs no checks, appears in no
list and does not count against the plan, but keeps its incidents and
availability history. Set on the single-monitor read and in the answers
of archive and restore; omitted elsewhere, since lists only ever hold
active monitors.
Severity des rohen jüngsten Checks (informativ; nicht für die Tönung).
Bestätigter Anzeige-Status für den Gesundheits-Punkt je Dienst:
failed (rot) = offener Incident/Quorum-Ausfall, degraded (gelb) =
unbestätigtes Problem (z. B. einzelner Vantage-Point), passed (grün).
None = noch kein Check. Folgt damit derselben Logik wie Alarm/Push.
Confirmation-Policy (Alarmprofil/Inline). Nur in der Einzelansicht gefüllt; in Listen None.
object
Legacy per-monitor duration. A configured organization flow is the canonical effective source.
Examplegenerated
{ "alarm_gate": { "grace_seconds": 1, "origins": [ "example" ] }, "archived": true, "config": "example", "enabled": true, "id": "example", "interval_seconds": 1, "last_severity": "example", "last_status": "example", "name": "example", "policy": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "alert_profile_id": "example", "effective_alarm": { "alarm_consecutive": 1, "alarm_min_duration_seconds": 1, "alarm_quorum_mode": "example", "alarm_quorum_value": 1, "source": "example" }, "failed_interval_seconds": 1, "recovery_consecutive": 1, "recovery_quorum_mode": "example", "recovery_quorum_value": 1 }, "project_id": "example", "regions": [ "example" ], "slug": "example", "type": "example"}A field was refused; error and field name it
Body of a refused monitor write. Branch on error, which is stable;
message explains the refusal in English.
object
Stable code: quota_reached, name_taken, invalid_request,
unknown_type, empty_name, unknown_region, internal_region,
too_many_regions, alarm_standard_unreachable, invalid_target,
unknown_agent_metric, invalid_service_name, foreign_agent or
monitor_archived.
The refused field as a path into the monitor, such as config.url or
regions. Absent when no single field is at fault.
With too_many_regions: the most regions the plan checks a monitor from.
With alarm_standard_unreachable: the distinct regions the organization’s
alarm standard needs.
The reason as an English sentence that names the field.
With invalid_target: what is wrong with the target. One of missing,
whitespace, scheme_in_host, path_in_host, malformed_label,
too_long, unsupported_scheme, no_host, needs_two_labels or
port_range.
Example
{ "error": "invalid_target", "field": "config.url", "reason": "unsupported_scheme"}Authentication is missing or invalid.
Plan limit: too_many_regions
Body of a refused monitor write. Branch on error, which is stable;
message explains the refusal in English.
object
Stable code: quota_reached, name_taken, invalid_request,
unknown_type, empty_name, unknown_region, internal_region,
too_many_regions, alarm_standard_unreachable, invalid_target,
unknown_agent_metric, invalid_service_name, foreign_agent or
monitor_archived.
The refused field as a path into the monitor, such as config.url or
regions. Absent when no single field is at fault.
With too_many_regions: the most regions the plan checks a monitor from.
With alarm_standard_unreachable: the distinct regions the organization’s
alarm standard needs.
The reason as an English sentence that names the field.
With invalid_target: what is wrong with the target. One of missing,
whitespace, scheme_in_host, path_in_host, malformed_label,
too_long, unsupported_scheme, no_host, needs_two_labels or
port_range.
Example
{ "error": "invalid_target", "field": "config.url", "reason": "unsupported_scheme"}The authenticated caller does not have permission to perform this operation.
No accessible resource matches the supplied identifier.
The monitor is archived. The body carries the error code monitor_archived; restore the monitor first.
Body of a refused monitor write. Branch on error, which is stable;
message explains the refusal in English.
object
Stable code: quota_reached, name_taken, invalid_request,
unknown_type, empty_name, unknown_region, internal_region,
too_many_regions, alarm_standard_unreachable, invalid_target,
unknown_agent_metric, invalid_service_name, foreign_agent or
monitor_archived.
The refused field as a path into the monitor, such as config.url or
regions. Absent when no single field is at fault.
With too_many_regions: the most regions the plan checks a monitor from.
With alarm_standard_unreachable: the distinct regions the organization’s
alarm standard needs.
The reason as an English sentence that names the field.
With invalid_target: what is wrong with the target. One of missing,
whitespace, scheme_in_host, path_in_host, malformed_label,
too_long, unsupported_scheme, no_host, needs_two_labels or
port_range.
Example
{ "error": "invalid_target", "field": "config.url", "reason": "unsupported_scheme"}