---
title: "create_notification_rule — AI Ability"
description: "Create a notification rule — Alert someone when a delivery reaches a state: the event, optional filters, the channels, an optional template, quiet time and digest."
url: "https://wpwebhooks.org/docs/ability-create-notification-rule/"
---

[WP Webhooks](https://wpwebhooks.org/) / [Docs](https://wpwebhooks.org/docs/) / create\_notification\_rule

AI Ability since v3.3.0

# create\_notification\_rule

Create a notification rule — Alert someone when a delivery reaches a state: the event, optional filters, the channels, an optional template, quiet time and digest.

Creates a notification rule. `event` is one of `success`, `recovered`, `failed_attempt`, `retry_scheduled`, `permanently_failed`, `skipped`. `webhook_id` scopes the rule to one webhook (a plan may reference a webhook created earlier as `{{step_N.id}}`); omit it for a site-wide rule. `channel_ids` come from `list_notification_channels`. `filters` are all optional: `attempts` (which attempt numbers), `http_codes` (`"5xx"`, `"429"`, `"500-504"`, `"transport"`), `reason` (`exhausted` | `non_retryable`, permanently\_failed only), `triggers` (`"woocommerce_*"`), `only_after_retry`, `include_tests`. `template` is `{subject, title, body, short}` with `{{ path | modifier }}` placeholders — the shared linter checks it against the webhook's captured payload and **rejects unknown paths with the list of what is available**, so the model corrects itself instead of storing a template that renders blanks. `throttle_seconds` quiets repeats per webhook; `digest` batches them hourly or daily. Registered as the WordPress Ability `flowsystems-webhook-actions/create-notification-rule`, so external AI tools (Claude Code, Cursor) can call it over MCP, or over the Abilities REST route with a scoped API token.

/ Plan step shape

```
{ "ability": "create_notification_rule", "input": { "event": …, "channel_ids": […], "webhook_id": …, "filters": {…}, "template": {…} } }
```

/ Scope & confirmation

Minimum API-token scope for external (MCP/REST) callers: `full`. Runs without a confirmation pause (the overall plan is still user-approved before execution starts). The result includes a rendered preview of the message so the plan review shows what will be sent.

/ Input fields

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| event | param | string | yes | \`success\` | \`recovered\` | \`failed\_attempt\` | \`retry\_scheduled\` | \`permanently\_failed\` | \`skipped\`. |
| channel\_ids | param | integer\[\] | yes | From \`list\_notification\_channels\`. |
| webhook\_id | param | integer | — | Scope to one webhook; omit for site-wide. |
| name | param | string | — |  |
| filters | param | object | — | \`attempts\`, \`http\_codes\`, \`reason\`, \`triggers\`, \`only\_after\_retry\`, \`include\_tests\`. |
| template | param | object | — | \`subject\`, \`title\`, \`body\`, \`short\` — linted against the captured payload. |
| throttle\_seconds | param | integer | — | At most one message per webhook in this window. |
| digest | param | string | — | \`hourly\` | \`daily\`. |
| is\_enabled | param | boolean | — | Default true. |

/ Examples

Plan step as Build with AI proposes it

```
{
  "id": "step_4",
  "ability": "create_notification_rule",
  "summary": "Post to #ops-alerts when the HubSpot sync gives up",
  "input": {
    "webhook_id": "{{step_1.id}}",
    "event": "permanently_failed",
    "channel_ids": [3],
    "template": {
      "body": "Order {{ payload.order.id }} did not reach HubSpot: {{ delivery.error_message | truncate:120 }}"
    }
  }
}
```

/ Related

[list\_notification\_channels](https://wpwebhooks.org/docs/ability-list-notification-channels/)[update\_notification\_rule](https://wpwebhooks.org/docs/ability-update-notification-rule/)[test\_notification\_rule](https://wpwebhooks.org/docs/ability-test-notification-rule/)[Notifications](https://wpwebhooks.org/docs/notifications/)[Build with AI](https://wpwebhooks.org/docs/build-with-ai/)[REST API reference](https://wpwebhooks.org/webhook-wordpress-plugin-api/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://downloads.wordpress.org/plugin/flowsystems-webhook-actions.zip) [Try the Live Preview](https://playground.wordpress.net/?blueprint-url=https://wpwebhooks.org/blueprint.json) [See the Plugin →](https://wpwebhooks.org/wordpress-webhook-plugin/)

$ wp plugin install flowsystems-webhook-actions --activate

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"create_notification_rule — AI Ability — Webhook Actions Docs","description":"Create a notification rule — Alert someone when a delivery reaches a state: the event, optional filters, the channels, an optional template, quiet time and digest.","url":"https://wpwebhooks.org/docs/ability-create-notification-rule/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
