---
title: "Update alert rule"
method: PUT
path: "/api/v1/projects/{projectId}/alerts/rules/{ruleId}"
tags: ["Alerts"]
---

# Update alert rule

`PUT /api/v1/projects/{projectId}/alerts/rules/{ruleId}`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/projects/{projectId}/alerts/rules/{ruleId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Changes the threshold, the channels or the enabled state. Alerts already fired are left as they are.

## Path parameters

- `projectId` string, uuid, required
- `ruleId` string, uuid, required

## Request body

- AlertRuleRequest
  - `name` string, required
  - `description` string
  - `alertType` string, required: The id of a condition listed by GET /api/v1/alert-conditions
  - `severity` 'INFO' | 'WARNING' | 'CRITICAL'
  - `channel` string: The id of a channel listed by GET /api/v1/alert-channels; IN_APP when left out
  - `channelConfig` object: Settings named by the channel's configSchema. On update a setting left out is kept; a blank one clears it, except a secret, which is kept so an edit need not re-enter it.
  - `thresholdValue` number, double: Required when the condition's configSchema lists it
  - `windowMinutes` integer
  - `endpointId` string, uuid
  - `enabled` boolean
  - `muted` boolean
  - `snoozedUntil` string, date-time

## Response `200`

OK

---

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