Create a monitor in a project
const url = 'https://api.perstat.io/projects/example/monitors';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"config":"example","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 POST \ --url https://api.perstat.io/projects/example/monitors \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "config": "example", "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" }'Creates a monitor of the given type with its configuration, check interval, probe regions, and optional confirmation policy (an alert profile reference or inline quorum values). The interval is raised to the plan minimum and clamped between 30 seconds and 24 hours, omitted regions fall back to a preselected default set, and plan limits on monitor count or region count return 402. Agent monitors instead bind to an enrolled agent, are evaluated server-side, and accept metric-specific configuration such as thresholds or grace periods. A name that collides with an existing monitor slug in the project returns 409. Refusals (400, 402, 409) carry a JSON body with a stable error code such as invalid_target, too_many_regions, quota_reached or name_taken, the refused field as a path such as config.url, for a malformed target the reason such as scheme_in_host, and an English message.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Confirmation-Policy (Alarmprofil-Zuweisung oder Inline-Eigenwerte).
object
Legacy per-monitor duration. A configured organization flow is the canonical effective source.
Pruef-Regionen. Weggelassen/leer → 3 vorausgewaehlte (ewr/fra/sgp).
Examplegenerated
{ "config": "example", "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”object
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" ] }, "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 or foreign_agent.
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"}Plan limit: quota_reached or 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 or foreign_agent.
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"}Role may not manage monitors
name_taken
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 or foreign_agent.
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"}