fastmon Docs
Notifications

Create a notification rule

Fehler melden

Create a new rule together with its actions in a single call. The scope target (site or tag) is validated against the org. Requires org owner role.

Authentifizierung

bearerAuth
headerAuthentifizierungBearer <token>

API token generated from the fastmon dashboard (Account → API Token) or at organization level (fmo_…, one that outlives its creator). Send as Authorization: Bearer fm_... or paste the full token (including its prefix) into the Authorize dialog.

Pfad-Parameter

org_id*Org Id
Formatuuid

Request-Body

application/json
  1. body
name*Name

What the rule is called in the list and in the notification it sends.

Length1 <= length <= 100
is_active?Is Active

Whether the rule is evaluated at all.

Defaulttrue
scope_type*ScopeType

What the rule watches: one domain, or every domain carrying a tag.

Value in"site""tag"
site_id?|

The domain, when scope_type is site.

tag?|

The tag, when scope_type is tag.

metric*Metric

Which measurement is compared, for example lcp or error_count.

aggregation*Aggregation

How the measurement is reduced over the window, a percentile or an average.

identity?|

Which identifier counts a visitor, for metrics that count visitors.

operator*Operator

How the value is compared with the threshold.

Value in"gt""gte""lt""lte"
condition_type*ConditionType

Whether the threshold is an absolute value or a change against the baseline window.

Value in"absolute""relative_change"
threshold*Threshold

The number the value is compared with. A ratio for a relative change.

window_seconds*Window Seconds

How much recent data one evaluation looks at.

baseline_window_seconds?|

The window a relative change is measured against. Only for relative_change.

filters?|

Narrow what is measured, for example to one country or one device type.

re_notify_after_seconds?|

How long to stay quiet before notifying again while the condition holds. At least an hour. Null notifies once per episode.

actions*array<>

Where a notification goes. At least one.

Items1 <= items <= 10

Response-Body

Successful Response

application/json
  1. response
id*Id

Identifier of the rule.

Formatuuid
organization_id*Organization Id

The organization the rule belongs to.

Formatuuid
name*Name

What the rule is called in the list and in the notification it sends.

is_active*Is Active

Whether the rule is evaluated at all.

scope_type*ScopeType

What the rule watches: one domain, or every domain carrying a tag.

Value in"site""tag"
site_id?Site Id

The domain, when scope_type is site.

Formatuuid
tag?Tag

The tag, when scope_type is tag.

metric*Metric

Which measurement is compared, for example lcp or error_count.

aggregation*RuleAggregation

How the measurement is reduced over the window, a percentile or an average.

Value in"count""avg""sum""min""max""p50""p75""p90""p95""p99"
identity?Identity

Which identifier counts a visitor, for metrics that count visitors.

operator*Operator

How the value is compared with the threshold.

Value in"gt""gte""lt""lte"
condition_type*ConditionType

Whether the threshold is an absolute value or a change against the baseline window.

Value in"absolute""relative_change"
threshold*Threshold

The number the value is compared with. A ratio for a relative change.

window_seconds*Window Seconds

How much recent data one evaluation looks at.

baseline_window_seconds?Baseline Window Seconds

The window a relative change is measured against. Only for relative_change.

filters?

Narrow what is measured, for example to one country or one device type.

re_notify_after_seconds?Re Notify After Seconds

How long to stay quiet before notifying again while the condition holds. At least an hour. Absent notifies once per episode.

last_evaluated_at?Last Evaluated At

When it was last evaluated. Absent until the first run.

Formatdate-time
created_at*Created At

When it was created.

Formatdate-time
updated_at*Updated At

When it last changed.

Formatdate-time
actions*array<>

Where a notification goes.

POST
/organizations/{org_id}/notifications/rules
curl -X POST 'https://api.fastmon.eu/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/notifications/rules' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "scope_type": "site",  "metric": "string",  "aggregation": "string",  "operator": "gt",  "condition_type": "absolute",  "threshold": 0,  "window_seconds": 0,  "actions": [    {      "type": "email",      "config": {}    }  ]}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",  "name": "string",  "is_active": true,  "scope_type": "site",  "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",  "tag": "string",  "metric": "string",  "aggregation": "count",  "identity": "string",  "operator": "gt",  "condition_type": "absolute",  "threshold": 0,  "window_seconds": 0,  "baseline_window_seconds": 0,  "filters": {},  "re_notify_after_seconds": 0,  "last_evaluated_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "actions": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "type": "email",      "is_active": true,      "config": {}    }  ]}