---
title: "Update a notification rule"
method: PUT
path: "/api/v1/notification/rules/{ruleId}"
tags: ["Notifications"]
---

# Update a notification rule

`PUT /api/v1/notification/rules/{ruleId}`

Update notification rule.

## Path parameters

- `ruleId` string, required

## Request body

- union — Union type for requests creating new notification rule with certain type.
  - object — Request with input parameters for creating new notification rule with entitlements.balance.threshold type.
    - `type` 'entitlements.balance.threshold', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `thresholds` NotificationRuleBalanceThresholdValue[], required — List of thresholds the rule suppose to be triggered.
      - `value` number, double, required — Value of the threshold.
      - `type` 'PERCENT' | 'NUMBER' | 'balance_value' | 'usage_percentage' | 'usage_value', required — Type of the rule in the balance threshold specification: * `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period * `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period * `usage_value`: threshold defined by the usage value in the current usage period * `NUMBER` (**deprecated**): see `usage_value` * `PERCENT` (**deprecated**): see `usage_percentage`
    - `channels` string[], required — List of notification channels the rule is applied to.
    - `features` string[] — Optional field for defining the scope of notification by feature. It may contain features by id or key.
  - object — Request with input parameters for creating new notification rule with entitlements.reset type.
    - `type` 'entitlements.reset', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `channels` string[], required — List of notification channels the rule is applied to.
    - `features` string[] — Optional field for defining the scope of notification by feature. It may contain features by id or key.
  - object — Request with input parameters for creating new notification rule with invoice.created type.
    - `type` 'invoice.created', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `channels` string[], required — List of notification channels the rule is applied to.
  - object — Request with input parameters for creating new notification rule with invoice.updated type.
    - `type` 'invoice.updated', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `channels` string[], required — List of notification channels the rule is applied to.

## Response `200`

The request has succeeded.

- union — Notification Rule.
  - object — Notification rule with entitlements.balance.threshold type.
    - `createdAt` string, date-time, required — Timestamp of when the resource was created.
    - `updatedAt` string, date-time, required — Timestamp of when the resource was last updated.
    - `deletedAt` string, date-time — Timestamp of when the resource was permanently deleted.
    - `id` string, required — Identifies the notification rule.
    - `type` 'entitlements.balance.threshold', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `channels` NotificationChannelMeta[], required — List of notification channels the rule applies to.
      - `id` string, required — Identifies the notification channel.
      - `type` 'WEBHOOK', required — Type of the notification channel.
    - `annotations` Annotations — Set of key-value pairs managed by the system. Cannot be modified by user.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `thresholds` NotificationRuleBalanceThresholdValue[], required — List of thresholds the rule suppose to be triggered.
      - `value` number, double, required — Value of the threshold.
      - `type` 'PERCENT' | 'NUMBER' | 'balance_value' | 'usage_percentage' | 'usage_value', required — Type of the rule in the balance threshold specification: * `balance_value`: threshold defined by the remaining balance value based on usage and the total of grants in the current usage period * `usage_percentage`: threshold defined by the usage percentage compared to the total of grants in the current usage period * `usage_value`: threshold defined by the usage value in the current usage period * `NUMBER` (**deprecated**): see `usage_value` * `PERCENT` (**deprecated**): see `usage_percentage`
    - `features` FeatureMeta[] — Optional field containing list of features the rule applies to.
      - `id` string, required — Unique identifier of a feature.
      - `key` string, required — The key is an immutable unique identifier of the feature used throughout the API, for example when interacting with a subject's entitlements.
  - object — Notification rule with entitlements.reset type.
    - `createdAt` string, date-time, required — Timestamp of when the resource was created.
    - `updatedAt` string, date-time, required — Timestamp of when the resource was last updated.
    - `deletedAt` string, date-time — Timestamp of when the resource was permanently deleted.
    - `id` string, required — Identifies the notification rule.
    - `type` 'entitlements.reset', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `channels` NotificationChannelMeta[], required — List of notification channels the rule applies to.
      - `id` string, required — Identifies the notification channel.
      - `type` 'WEBHOOK', required — Type of the notification channel.
    - `annotations` Annotations — Set of key-value pairs managed by the system. Cannot be modified by user.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
    - `features` FeatureMeta[] — Optional field containing list of features the rule applies to.
      - `id` string, required — Unique identifier of a feature.
      - `key` string, required — The key is an immutable unique identifier of the feature used throughout the API, for example when interacting with a subject's entitlements.
  - object — Notification rule with invoice.created type.
    - `createdAt` string, date-time, required — Timestamp of when the resource was created.
    - `updatedAt` string, date-time, required — Timestamp of when the resource was last updated.
    - `deletedAt` string, date-time — Timestamp of when the resource was permanently deleted.
    - `id` string, required — Identifies the notification rule.
    - `type` 'invoice.created', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `channels` NotificationChannelMeta[], required — List of notification channels the rule applies to.
      - `id` string, required — Identifies the notification channel.
      - `type` 'WEBHOOK', required — Type of the notification channel.
    - `annotations` Annotations — Set of key-value pairs managed by the system. Cannot be modified by user.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.
  - object — Notification rule with invoice.updated type.
    - `createdAt` string, date-time, required — Timestamp of when the resource was created.
    - `updatedAt` string, date-time, required — Timestamp of when the resource was last updated.
    - `deletedAt` string, date-time — Timestamp of when the resource was permanently deleted.
    - `id` string, required — Identifies the notification rule.
    - `type` 'invoice.updated', required — Notification rule type.
    - `name` string, required — The user friendly name of the notification rule.
    - `disabled` boolean — Whether the rule is disabled or not.
    - `channels` NotificationChannelMeta[], required — List of notification channels the rule applies to.
      - `id` string, required — Identifies the notification channel.
      - `type` 'WEBHOOK', required — Type of the notification channel.
    - `annotations` Annotations — Set of key-value pairs managed by the system. Cannot be modified by user.
    - `metadata` Metadata — Set of key-value pairs. Metadata can be used to store additional information about a resource.

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
- `401` — The request has not been applied because it lacks valid authentication credentials for the target resource.
- `403` — The server understood the request but refuses to authorize it.
- `404` — The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
- `412` — One or more conditions given in the request header fields evaluated to false when tested on the server.
- `500` — The server encountered an unexpected condition that prevented it from fulfilling the request.
- `503` — The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.
- `default` — An unexpected error response.

---

[API](https://skmtc.net/openmeterio/apis/openmeter-api.md) · [All operations](https://skmtc.net/openmeterio/apis/openmeter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmeterio/openmeter-api/versions/927d82ffe647/schema)
