Skip to content

Restore an archived monitor

POST
/monitors/{monitor_id}/restore
curl --request POST \
--url https://api.perstat.io/monitors/example/restore \
--header 'Authorization: Bearer <token>'

Brings an archived monitor back into the monitor lists. Restoring does not resume checks: the monitor comes back paused, as archiving left it, and PATCH /monitors/{monitor_id} with enabled: true puts it back to work. A restored monitor counts against the plan’s allowance again, so on a full plan the restore is refused with 402 and the error code quota_reached, exactly like creating a monitor, and the monitor stays archived. If another monitor in the project has taken its slug in the meantime, it keeps the suffixed slug it was given when archived.

Idempotent: Restoring a monitor that is not archived changes nothing and returns it unchanged.

Permissions: Requires a project management role in the owning organization. The change is recorded in the activity log. Accepts API keys with the monitors:write scope, subject to current role and resource grants.

monitor_id
required
string

The restored monitor, with archived: false.

Media typeapplication/json
object
alarm_gate
One of:
null
archived

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.

boolean | null
config
required
enabled
required
boolean
id
required
string
interval_seconds
required
integer format: int32
last_severity

Severity des rohen jüngsten Checks (informativ; nicht für die Tönung).

string | null
last_status

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.

string | null
name
required
string
policy
One of:
null
project_id
required
string
regions
required
Array<string>
slug
required
string
type
required
string
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"
}

Authentication is missing or invalid.

The plan’s allowance for this kind of monitor is used up. The body carries the error code quota_reached; the monitor stays archived.

Media typeapplication/json

Body of a refused monitor write. Branch on error, which is stable; message explains the refusal in English.

object
error
required

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.

string
field

The refused field as a path into the monitor, such as config.url or regions. Absent when no single field is at fault.

string | null
limit

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.

integer | null format: int64
message
required

The reason as an English sentence that names the field.

string
reason

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.

string | null
Example
{
"error": "invalid_target",
"field": "config.url",
"reason": "unsupported_scheme"
}

The authenticated caller does not have permission to restore this monitor.

No accessible monitor matches the supplied monitor ID.