Test notification filter
Evaluates a notification filter against an alert event and returns whether the filter passes.
Use this endpoint to test filter behavior before saving a subscription filter.
This endpoint only evaluates filters. It does not create or update notification subscriptions.
Request modes
- Use
eventIdwhen you want to test against an existing stored alert event - Use
eventwhen you want to submit a modified event body for a custom test case
Request body
| Field | Type | Required | Description |
|---|---|---|---|
filter | object | Yes | Filter expression to evaluate |
event | object | Conditionally | Event payload to evaluate against |
eventId | string | Conditionally | Existing event identifier to load and evaluate |
prevEvent | object | No | Previous event payload used when the filter depends on prior state |
overrides | object | No | Override values for selected computed max fields during evaluation |
Provide either event or eventId.
You can obtain eventId values from the Alerts API event endpoints, such as List alert events and Get alert event.
If you want to provide a custom event body instead of eventId, start from an alert event returned by the Alerts API and modify it for your test case.
Request behavior
- If
eventIdis provided, the API resolves the event from the caller's environment - If
prevEventis omitted andeventIdresolves to an event with a prior sequence, the API attempts to load the previous event automatically overridescan be used to inject test values for computed max fields without changing stored data- Invalid request bodies return
400 - If
eventIdis not found, the endpoint returns404 - Filter evaluation errors return
200with anerrorfield in the response body
computed values based on historical notification stats are not populated unless you provide them through overrides.
Event-derived computed values, such as current values, previous values, and presence arrays, are still included in the evaluation context.
Response
200 OK
| Field | Type | Description |
|---|---|---|
pass | boolean | Whether the filter matched the evaluated event |
error | string | Present when filter evaluation fails |
trace | object | Values resolved for variable paths referenced by the filter; use this to understand why the filter passed or failed |
context | object | Full evaluation context used for the filter test |
Errors
400: invalid request body, invalidfilter, invalideventId, or neithereventnoreventIdwas provided404:eventIdnot found
Example request
{
"filter": {
">=": [
{
"var": "computed.impact.max_24h"
},
3
]
},
"eventId": "alert-123|7",
"overrides": {
"impact": {
"max_24h": 4
}
}
}
Example response
{
"pass": true,
"trace": {
"computed.impact.max_24h": 4
},
"context": {
"event": {},
"computed": {
"impact": {
"max_24h": 4
}
}
}
}