Skip to main content
POST
/
monit
/
rule
/
import
Import alert rules
curl --request POST \
  --url 'https://api.flashcat.cloud/monit/rule/import?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "folder_id": 100,
    "name": "CPU High",
    "ds_type": "prometheus",
    "ds_list": [
      "prometheus*"
    ],
    "enabled": true,
    "cron_pattern": "* * * * *",
    "rule_configs": {
      "queries": [
        {
          "name": "A",
          "expr": "avg(cpu_usage_idle) < 10"
        }
      ]
    }
  }
]
'
{
  "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
  "data": [
    {
      "name": "CPU High",
      "message": ""
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.flashcat.cloud/llms.txt

Use this file to discover all available pages before exploring further.

Restrictions

AspectValue
Rate limits20 requests/minute; 2 requests/second per account
PermissionsAlerting Rules Manage (monit)

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 either ds_list or ds_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
string
query
required

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

application/json
id
integer<uint64>
account_id
integer<uint64>
folder_id
integer<uint64>

Folder the rule belongs to.

name
string

Rule name.

labels
object

Custom labels.

ds_type
string

Data source type.

ds_list
string[]

Data source name patterns (supports wildcards).

ds_ids
integer<uint64>[]

Specific data source IDs.

enabled
boolean
debug_log_enabled
boolean
rule_configs
object

Rule evaluation configuration.

cron_pattern
string

5-field cron schedule.

delay_seconds
integer
enabled_times
object[]

Time windows when the rule is active.

annotations
object
description_type
enum<string>
Available options:
text,
markdown
description
string
channel_ids
integer<uint64>[]

Channel IDs to send alerts to.

repeat_interval
integer<int64>

Notification repeat interval in seconds.

repeat_total
integer<int64>

Max number of repeat notifications.

creator_id
integer<uint64>
creator_name
string
updater_id
integer<uint64>
updater_name
string
created_at
integer<int64>
updated_at
integer<int64>

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.

request_id
string
required

Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.

Example:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object[]
required

Import result for each rule.