---
title: "Update an alert rule"
method: PATCH
path: "/v1/alert-rules/{id}"
tags: ["Alert rules"]
---

# Update an alert rule

`PATCH /v1/alert-rules/{id}`

## Request

- Base URL: `https://api.upcheck.so`
- URL: `https://api.upcheck.so/v1/alert-rules/{id}`
- Auth: HTTP bearer

Send only the fields to change. `{ "enabled": false }` pauses a rule without touching its scope.

## Path parameters

- `id` string, required

## Request body

- object: Fields to change. Omitted fields are left as they are.
  - `name` string
  - `enabled` boolean
  - `subject` 'http' | 'certificate' | 'dns' | 'registration' | 'keyword' | 'content' | 'port': Which check a monitor, rule or history row is about.
  - `triggers` object[]: Thresholds or events the rule fires on. Duplicates are collapsed and the list is sorted widest first.
    - `type` 'days' | 'weeks' | 'on_expiration' | 'http_down' | 'http_slow' | 'port_down' | 'dns_changed' | 'keyword_failed' | 'content_changed' | 'content_failed' | 'recovered', required
    - `value` integer, required: Days or weeks before expiry for `days`/`weeks`; ignored for event triggers.
  - `frequency` 'once' | 'daily' | 'every_12h' | 'every_6h' | 'hourly': How often a rule may re-deliver the same alert while the condition holds.
  - `channels` string[]
  - `integrationIds` string[], nullable: Integrations the webhook channels deliver to. A selected channel with no integration listed here delivers to every integration on that channel. Ids outside this organization are ignored.
  - `emailListIds` string[]
  - `emailRecipients` string[]
  - `domainIds` string[], nullable: Websites the rule is scoped to. Empty or null means every website in the organization.

## Response `200`

The updated rule.

- object
  - `id` string, required: Opaque identifier.
  - `organizationId` string, required: Opaque identifier.
  - `name` string, required
  - `enabled` boolean, required
  - `subject` 'http' | 'certificate' | 'dns' | 'registration' | 'keyword' | 'content' | 'port', nullable, required: Which check a monitor, rule or history row is about.
  - `triggerType` 'days' | 'weeks' | 'on_expiration' | 'http_down' | 'http_slow' | 'port_down' | 'dns_changed' | 'keyword_failed' | 'content_changed' | 'content_failed' | 'recovered', required
  - `triggerValue` number, required
  - `triggers` object[], nullable, required
    - `type` 'days' | 'weeks' | 'on_expiration' | 'http_down' | 'http_slow' | 'port_down' | 'dns_changed' | 'keyword_failed' | 'content_changed' | 'content_failed' | 'recovered', required
    - `value` integer, required: Days or weeks before expiry for `days`/`weeks`; ignored for event triggers.
  - `domainIds` string[], nullable, required
  - `frequency` 'once' | 'daily' | 'every_12h' | 'every_6h' | 'hourly', required: How often a rule may re-deliver the same alert while the condition holds.
  - `channels` string[], required
  - `integrationIds` string[], nullable, required
  - `emailListIds` string[], nullable, required
  - `emailRecipients` string[], nullable, required
  - `createdByEmail` string, nullable, required
  - `createdAt` number, required

## Other responses

- `400`: The request body or parameters are invalid. `error` names the first problem.
- `401`: The API key is missing, invalid, or revoked.
- `403`: The key's role does not allow this action.
- `404`: No such resource in this organization.
- `429`: The key's rate limit was exceeded. Honour `Retry-After`.

---

[API](https://skmtc.dev/upcheck/apis/upcheck-api.md) · [All operations](https://skmtc.dev/upcheck/apis/upcheck-api/llms.txt) · [OpenAPI document](https://skmtc.dev/upcheck/apis/upcheck-api/revisions/56f55512eb8a?raw)
