Import alert rules
Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.
Restrictions
Usage
- The request body is a JSON array of rule export objects (compatible with the output of
POST /monit/rule/export). - Each object must include
folder_id,ds_type, and eitherds_listords_ids. - Some rules may fail (e.g. duplicate name). Check each result for individual status.
- Every call is recorded in the account audit log. Don’t put secrets in request fields.
Authorizations
App key issued from the Flashduty console under Account → APP Keys. Required on every public API call. Keep it secret — it grants the same access as the owning account.
Body
Rule ID. Required for update; omit for create (assigned by the server).
Account ID. Filled by the server from the authenticated identity; do not provide.
ID of the folder the rule belongs to. Obtainable via POST /monit/folder/list.
Rule name. Must be unique within the same folder.
Custom labels.
Datasource type identifier; allowed values are listed by POST /monit/rule/dstypes (e.g. prometheus, elasticsearch).
Data source name patterns (supports wildcards).
Datasource IDs, merged with ds_list to decide which datasources the rule monitors; IDs survive datasource renames. At least one of ds_list and ds_ids must be provided.
Whether the rule is enabled. Updating to false makes the server clean up the rule's active alerts.
Whether to enable debug logging; the edge emits detailed evaluation logs, useful for troubleshooting rules that do not trigger as expected.
Check configuration: query list plus trigger/recovery conditions. Structure see RuleConfigs.
Schedule expression: a 6-field cron (with seconds) or an @every 30s interval descriptor. Must not start with CRON_TZ= or TZ=; use the timezone field instead.
Timezone in which the rule executes. Determines how the cron schedule and effective time windows are interpreted. Only IANA timezone names are accepted (e.g. Asia/Shanghai, UTC, Europe/London); shortcuts and offsets such as Local, UTC+8, or CST are rejected. Treated as Asia/Shanghai if empty.
Seconds to shift the evaluation query window backward, compensating for data ingestion latency.
Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.
Annotation key-value pairs delivered with alert events; keys must not start with $ (reserved for query fields).
Format for the description. Defaults to text when omitted or empty. text = plain text; markdown = Markdown, rendered as Markdown in alert details.
text, markdown Rule description, in Markdown.
Channel IDs to send alerts to.
Notification repeat interval in seconds.
Max number of repeat notifications.
Creator user ID. Filled by the server from the current user; do not provide.
Creator name. Filled by the server; do not provide.
Last updater user ID. Filled by the server; do not provide.
Last updater name. Filled by the server; do not provide.
Creation time as a Unix timestamp in seconds. Generated by the server; do not provide.
Last update time as a Unix timestamp in seconds. Generated by the server; do not provide.
Response
Success
Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.