# Change an uptime check

Change what a check requests, how often, when it counts as down, and who it tells.

Replace _check-id_ with the check's id. Send only the fields to change.

**Important:**
Changing what the check requests or what counts as up (the type, URL, method, expected status,
keyword, keyword mode, redirects or TLS verification) starts a running check over as `pending` and
closes an open outage without telling anyone. Changing its name, interval, timeout, thresholds or
recipients does not.

## Prerequisites

- Permission for `monitoring:UpdateCheck` on the check,
  `rn:ews::<organization id>:monitoring:check/<check id>`.

## Change the check

**Console:** not available. The console shows a check's settings but does not change them.
**CLI**
```sh
dcloud monitoring checks update check-id --interval-seconds 300 --failure-threshold 3
```

**API**
```http
PATCH /monitoring/api/checks/check-id
{ "intervalSeconds": 300, "failureThreshold": 3, "confirmations": 1 }
```

`notifyEmails` replaces the list; `"webhookUrl": null` removes the webhook. Switching `type` to
`http` without a `keyword` drops the keyword.

**Terraform**
Change the arguments of the `dcloud_uptime_check` and apply.

## When the change is refused

The check as it would be after the change is checked as a whole:

- `400` when the fields disagree, for example "Only a keyword check has a keyword".
- `409` "A check named "…" already exists" for a new name that is taken.
- `409` "… is already checked … times a minute by …; at most 6 a minute across all checks. Choose a
  longer interval." when a running check's new host or shorter interval would pass the limit.
- `404` "Check not found" when your organization has no such check.

## Related

- [How uptime checks work](how-uptime-checks-work.md)
- [Pause or resume a check](pause-or-resume-a-check.md)
- `monitoring.checks.update` · `dcloud monitoring checks update` · `dcloud_uptime_check`
