Skip to main content
POST
/
monit
/
rule
/
create
Create alert rule
curl --request POST \
  --url 'https://api.flashcat.cloud/monit/rule/create?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "folder_id": 100,
  "name": "CPU High",
  "ds_type": "prometheus",
  "ds_list": [
    "prometheus*"
  ],
  "enabled": true,
  "cron_pattern": "* * * * *",
  "channel_ids": [
    20001
  ],
  "rule_configs": {
    "queries": [
      {
        "name": "A",
        "expr": "avg(cpu_usage_idle) < 10"
      }
    ],
    "check_threshold": {
      "enabled": true,
      "critical": "A",
      "alerting_check_times": 1,
      "recovery_check_times": 1,
      "push_recovery_event": true,
      "recovery": {
        "mode": "invert"
      }
    }
  }
}
'
{
  "request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
  "data": {
    "id": 50001,
    "folder_id": 100,
    "name": "CPU High",
    "ds_type": "prometheus",
    "created_at": 1712000000
  }
}

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 limits1,000 requests/minute; 50 requests/second per account
PermissionsAlerting Rules Manage (monit)

Usage

  • name, ds_type, cron_pattern, and rule_configs.queries are required.
  • Either ds_list (supports wildcards) or ds_ids must be non-empty.
  • cron_pattern uses standard 5-field cron syntax.
  • channel_ids can be empty; alerts will then route through the global integration.
  • 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

Full alert rule configuration.

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

Full alert rule configuration.