Skip to content

Modify v2



POST /api/v1/alert_policy/{alert_policy_uuid}/modify_v2

Overview

Modify an Alert Policy and fully maintain Monitor/SLO/Security Rule bindings.

Before Calling and Usage Steps

First read the details and replace them with the complete target alertOpt. Omitting alertOpt retains the original configuration. When provided, it must include aggInterval and cannot be cleared with {}. To disable aggregation and clear notification targets, submit a valid complete object, for example {"aggInterval":0,"alertTarget":[]}, and fill in other mode fields according to the current parameter descriptions. It is recommended to also submit the existing name, required ruleTimezone, and complete alertOpt to trigger deep validation. In the current code, notification-only configuration changes may skip deep validation, and success does not mean the target structure is necessarily executable. v2 maintains bindings at the same time. During modification, both checkerUUIDs and securityRuleUUIDs represent the complete target set; omitting either item also clears the corresponding binding as []. To retain them, you must first query details and pass them back in full. Clients must verify same-Workspace Monitors/SLOs/Security Rules item by item. The server may filter non-existent identifiers, but it does not fully validate Workspace ownership of all UUIDs. Success does not prove that the bindings are valid, nor does it provide item-by-item confirmation. In the current version, the top-level ruleTimezone is saved and displayed, but the execution cache reads the historical alertOpt.ruleTimezone, defaulting to Asia/Shanghai. Other time zones cannot be considered effective merely because saving succeeded. Integrators must verify against the actual execution time zone. Do not bypass public parameters through additional undeclared fields. Saving and cache refresh do not mean notification delivery. Actual sending depends on valid targets, event severity, time period, filters, duplicate suppression, and the alert execution service. After a failure or timeout, first read the policy and binding status. After verifying the saved configuration and bindings, handle only the incomplete modifications to avoid misjudging partial updates.

Path Parameters

Parameter Type Required Description
alert_policy_uuid string Y Alert Policy UUID in the current Workspace.
Example: altpl_example
How to obtain or specify: Get it from content.data[].uuid in the Alert Policy List, and verify with Alert Policy Details before modification.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the Workspace.
Example: <DF-API-KEY>
How to obtain or specify: Obtain an OpenAPI Key with the required operation permission from API Key management in the target Workspace.

Body Request Parameters

Parameter Type Required Description
permissionSet[*] string Single operable principal identifier; whether it takes effect also depends on identity and the current resource state.
Example: wsAdmin
How to obtain or specify: Use a role UUID (such as wsAdmin/general/readOnly/role_), acnt_ account, or group_ team; accounts/teams are subject to actual resources in this Workspace.
alertOpt.silentTimeoutByStatus[*] json Per-severity interval object.
Example: {"status": "critical,error", "silentTimeout": 600}
How to obtain or specify: Each item defines a group of severities and their seconds.
alertOpt.silentTimeoutByStatus[*].status string Non-security values: fatal/critical/error/warning/nodata/info/ALL; security values: security_critical/security_high/security_medium/security_low/security_info/security_ALL. Separate multiple values with English commas without spaces.
Example: critical,error
How to obtain or specify: Select from event severities; use the security_ prefix for security severities, such as security_high.
alertOpt.silentTimeoutByStatus[*].silentTimeout integer Required repetition interval for each group, in seconds. Invalid severities may trigger internal errors; validate before sending.
Example: 600
How to obtain or specify: Enter a non-negative integer number of seconds for the severity; 0 means no further periodic repetition.
alertOpt.aggFields[*] string Single aggregation field. For byCustom, choose based on actual event fields; do not guess fields only from display names.
Example: df_monitor_checker_id
How to obtain or specify: For event Monitors, use df_monitor_checker_id; for detection dimensions, use df_dimension_tags; for labels, use df_label; for historical intelligent aggregation, use CLUSTER.
alertOpt.aggLabels[*] string Single label value.
Example: production
How to obtain or specify: Take the label value from actual events.
alertOpt.aggClusterFields[*] string Single text field.
Example: df_title
How to obtain or specify: Use df_title for title and df_message for content.
alertOpt.alertTarget[*] json Rule object. When a fallback is needed, explicitly add a rule without time configuration; do not assume the system fills it in automatically.
Example: {"name": "默认通知", "targets": [{"status": "critical", "to": ["notify_example"]}]}
How to obtain or specify: Each item configures a time window or a fallback rule without time period restrictions.
alertOpt.alertTarget[*].name string Optional rule name, maximum 256 characters.
Example: 默认通知
How to obtain or specify: Name it according to business purpose.
alertOpt.alertTarget[*].crontab string Periodic start time expression; must be paired with crontabDuration. Choose one of this and the custom date approach.
Example: 0 9 * * 1-5
How to obtain or specify: Enter a Cron expression for the repetition start time, such as 9 AM on weekdays; also provide crontabDuration.
alertOpt.alertTarget[*].crontabDuration integer Duration of the periodic window in seconds; must be provided when crontab is provided; if no repetition period is configured, omit both.
Example: 28800
How to obtain or specify: Convert the time window length into a positive integer number of seconds, for example 28800 for 8 hours.
alertOpt.alertTarget[*].customDateUUIDs array Reference to a custom date set, up to 366 items; provide it together with customStartTime and customDuration, and do not use crontabDuration as a substitute.
Example: ["ndate_example"]
How to obtain or specify: Obtain date sets from content.data[].uuid in Custom Notification Dates; each item is a date configuration UUID, not a date string.
alertOpt.alertTarget[*].customDateUUIDs[*] string Single date configuration UUID.
Example: ndate_example
How to obtain or specify: Copy a valid date configuration UUID in the same Workspace from Custom Notification Dates.
alertOpt.alertTarget[*].customStartTime string Start time on the custom date, used together with customDateUUIDs/customDuration.
Example: 09:30:00
How to obtain or specify: Enter HH:MM:SS according to the local time of the selected date; interpreted in the actual execution time zone.
alertOpt.alertTarget[*].customDuration integer Duration of the custom date window in seconds; must be provided together with the date set and start time.
Example: 3600
How to obtain or specify: Enter a positive integer number of seconds for the window length, for example 3600 for 1 hour.
alertOpt.alertTarget[*].targets array Severity mode action array.
Example: [{"status": "critical", "to": ["notify_example"]}]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*] json Single severity action.
Example: {"status": "critical", "to": ["notify_example"]}
How to obtain or specify: Set one action for each event source and severity.
alertOpt.alertTarget[*].targets[*].status string Required severity selection: fatal, critical, error, warning, nodata, info; use uppercase ALL for all. Separate multiple values with English commas without spaces. For the security source, use critical, high, medium, low, info, or ALL.
Example: critical
How to obtain or specify: Take df_status from actual events; for security events, also set df_source=security.
alertOpt.alertTarget[*].targets[*].df_source string Optional; the public target structure supports only security. When omitted, the execution layer excludes the security source.
Example: security
How to obtain or specify: Fill in security only for Security Monitoring events; omit it for ordinary events.
alertOpt.alertTarget[*].targets[*].to array Required recipient target array; can use members, teams, Notification Targets, or email addresses; agent accounts can use their valid default Webhook.
Example: ["notify_example"]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*].to[*] string member mode commonly uses email/sms/notify_; status mode uses acnt_/agent_/group_/notify_ or email. Channel availability such as SMS depends on the site and target configuration.
Example: notify_example
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*].tags json status mode filters events by field value; member mode should use the parent alertInfo.filterString, and tags here are not used as member selection conditions.
Example: {"env": ["production"]}
How to obtain or specify: Organize a dictionary from raw event fields and values.
alertOpt.alertTarget[*].targets[*].tags.字段 array Array of match values for a single field.
Example: ["production"]
How to obtain or specify: Use actual event fields as keys, such as env; use an array of actual field values to match as values.
alertOpt.alertTarget[*].targets[*].tags.字段[*] string Single match value.
Example: production
How to obtain or specify: Take the value from the same field in the event.
alertOpt.alertTarget[*].targets[*].filterString string In status mode, when non-empty, takes precedence over tags and is used for escalation actions; in member mode, use the parent alertInfo.filterString, and fields in this target are not valid filter entry points.
Example: env:production
How to obtain or specify: Use the server-side FilterString syntax, for example env:production; generate complex conditions in the console and copy them.
alertOpt.alertTarget[*].targets[*].upgradeTargets array Optional escalation action; executed after the event remains at the corresponding severity for duration; [] means no escalation is configured.
Example: [{"to": ["acnt_example"], "duration": 600}]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*] json Single escalation action.
Example: {"to": ["acnt_example"], "duration": 600}
How to obtain or specify: Select the recipient target and wait seconds for each escalation.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*].to array In member mode, these are escalation recipient members/teams; in status mode, these are escalation notification targets, which can be members/teams/Notification Targets/email addresses.
Example: ["acnt_example"]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*].to[*] string Single escalation recipient identifier.
Example: acnt_example
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*].duration integer Required duration in seconds; each escalation is configured relative to the event's continuous state, and multiple durations are not automatically accumulated.
Example: 600
How to obtain or specify: Enter a positive integer number of seconds according to business requirements, for example 600 means the severity persists for 10 minutes.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*].toWay array member escalation notification method array; status mode does not use this field.
Example: ["email"]
How to obtain or specify: In member mode, choose from email/sms or notify_ objects in the Notification Target List; omit in status mode.
alertOpt.alertTarget[*].targets[*].upgradeTargets[*].toWay[*] string Single escalation notification method.
Example: email
How to obtain or specify: Choose an actually available email/sms or Notification Target UUID.
alertOpt.alertTarget[*].alertInfo array Member grouping array used only in member mode; status mode does not use it.
Example: [{"name": "生产负责人", "memberInfo": ["acnt_example"], "filterString": "env:production", "targets": [{"status": "critical", "to": ["email"]}]}]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*] json Member grouping object.
Example: {"name": "生产负责人", "memberInfo": ["acnt_example"], "targets": [{"status": "critical", "to": ["email"]}]}
How to obtain or specify: For each group, fill in the member scope, event conditions, and notification methods.
alertOpt.alertTarget[*].alertInfo[*].name string Optional member group name, maximum 256 characters.
Example: 生产负责人
How to obtain or specify: Name it according to the member group's business purpose.
alertOpt.alertTarget[*].alertInfo[*].memberInfo array Recipient member/team array for regular notifications in member mode, which may include agent accounts; combined with targets.to notification methods.
Example: ["acnt_example"]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].memberInfo[*] string Single member or team identifier.
Example: acnt_example
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].filterString string Member group-level event filter; both regular and escalation actions use this condition.
Example: env:production
How to obtain or specify: Organize it from actual event fields, for example env:production.
alertOpt.alertTarget[*].alertInfo[*].targets array Notification method/severity action array in member mode.
Example: [{"status": "critical", "to": ["email"]}]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*] json Single severity action.
Example: {"status": "critical", "to": ["email"]}
How to obtain or specify: Set one action for each event source and severity.
alertOpt.alertTarget[*].alertInfo[*].targets[*].status string Required severity selection: fatal, critical, error, warning, nodata, info; use uppercase ALL for all. Separate multiple values with English commas without spaces. For the security source, use critical, high, medium, low, info, or ALL.
Example: critical
How to obtain or specify: Take df_status from actual events; for security events, also set df_source=security.
alertOpt.alertTarget[*].alertInfo[*].targets[*].df_source string Optional; the public target structure supports only security. When omitted, the execution layer excludes the security source.
Example: security
How to obtain or specify: Fill in security only for Security Monitoring events; omit it for ordinary events.
alertOpt.alertTarget[*].alertInfo[*].targets[*].to array member mode commonly uses email, sms, or notify_ Notification Targets to indicate notification methods; the execution layer also supports direct account/team targets, but it is recommended to use memberInfo combined with notification methods first.
Example: ["email"]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*].to[*] string member mode commonly uses email/sms/notify_; status mode uses acnt_/agent_/group_/notify_ or email. Channel availability such as SMS depends on the site and target configuration.
Example: email
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*].tags json status mode filters events by field value; member mode should use the parent alertInfo.filterString, and tags here are not used as member selection conditions.
Example: {"env": ["production"]}
How to obtain or specify: Organize a dictionary from raw event fields and values.
alertOpt.alertTarget[*].alertInfo[*].targets[*].tags.字段 array Array of match values for a single field.
Example: ["production"]
How to obtain or specify: Use actual event fields as keys, such as env; use an array of actual field values to match as values.
alertOpt.alertTarget[*].alertInfo[*].targets[*].tags.字段[*] string Single match value.
Example: production
How to obtain or specify: Take the value from the same field in the event.
alertOpt.alertTarget[*].alertInfo[*].targets[*].filterString string In status mode, when non-empty, takes precedence over tags and is used for escalation actions; in member mode, use the parent alertInfo.filterString, and fields in this target are not valid filter entry points.
Example: env:production
How to obtain or specify: Use the server-side FilterString syntax, for example env:production; generate complex conditions in the console and copy them.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets array Optional escalation action; executed after the event remains at the corresponding severity for duration; [] means no escalation is configured.
Example: [{"to": ["acnt_example"], "duration": 600, "toWay": ["email"]}]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*] json Single escalation action.
Example: {"to": ["acnt_example"], "duration": 600, "toWay": ["email"]}
How to obtain or specify: Select the recipient target and wait seconds for each escalation.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].to array In member mode, these are escalation recipient members/teams; in status mode, these are escalation notification targets, which can be members/teams/Notification Targets/email addresses.
Example: ["acnt_example"]
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].to[*] string Single escalation recipient identifier.
Example: acnt_example
How to obtain or specify: For accounts, get content.data[].uuid from Workspace Members; for teams, get the group_ UUID from the member's member_group or team management; for Notification Targets, get the UUID from the Notification Target List. Use actual resources in the current Workspace for all.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].duration integer Required duration in seconds; each escalation is configured relative to the event's continuous state, and multiple durations are not automatically accumulated.
Example: 600
How to obtain or specify: Enter a positive integer number of seconds according to business requirements, for example 600 means the severity persists for 10 minutes.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].toWay array member escalation notification method array; status mode does not use this field.
Example: ["email"]
How to obtain or specify: In member mode, choose from email/sms or notify_ objects in the Notification Target List; omit in status mode.
alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].toWay[*] string Single escalation notification method.
Example: email
How to obtain or specify: Choose an actually available email/sms or Notification Target UUID.
checkerUUIDs[*] string Single Monitor or SLO UUID.
Example: rul_example
How to obtain or specify: Use the UUID of an actual Monitor or SLO in the same Workspace; do not enter an Alert Policy UUID.
securityRuleUUIDs[*] string Single Security Rule UUID.
Example: srul_example
How to obtain or specify: Use a Security Monitoring Rule UUID in the same Workspace.
name string Optional new name; omit to retain; it is recommended to submit the existing name to trigger deep parameter validation.
Allow null: False
Example: 生产服务告警
How to obtain or specify: Check existing names in this Workspace from the Alert Policy List, and choose an unused name.
desc string Optional description, maximum 256 characters. Omit on creation to use an empty string; omit on modification to retain; an empty string clears it.
Allow null: False
Allow empty string: True
Maximum length: 256
Example: 生产服务异常通知与升级。
How to obtain or specify: Fill in according to the business scope the policy is responsible for.
openPermissionSet boolean Optional custom operation permission switch; defaults to false on creation; omit on modification to retain. When enabled, the creator, owner, and identities that meet advanced operation permissions or permissionSet can operate.
Allow null: False
Example: false
How to obtain or specify: Enable when operations such as editing need to be restricted to specific roles, teams, or members; disable for regular control by API permissions.
permissionSet array Complete array of custom operation principals; can contain roles, accounts, and team identifiers; omit on creation for [], pass the entire array on modification to replace, and [] clears. The creator and owner are not locked out by an empty array.
Allow null: False
Example: ["wsAdmin"]
How to obtain or specify: Get role UUIDs from Workspace Roles, and account/team UUIDs from Workspace Members; do not enter role display names.
checkerUUIDs array Optional on v2 creation; on v2 modification, this is the complete target binding; omitting it or [] clears Monitor and SLO bindings.
Allow null: False
Example: ["rul_example"]
How to obtain or specify: Get actual UUIDs (rul_ or monitor_, etc.) from Monitor/Smart Monitoring/Intelligent Inspection/SLO configurations; you can also get existing bindings from refCheckerInfo in Alert Policy Details.
securityRuleUUIDs array Optional on v2 creation; on v2 modification, this is the complete target Security Rule binding; omitting it or [] clears.
Allow null: False
Example: ["srul_example"]
How to obtain or specify: Get the srul_ UUID from the Security Monitoring Rule list/console, or from refSecurityRuleInfo in Alert Policy Details.
ruleTimezone str Y Required time zone string for both creation and modification; saved to the policy entity; the current public version has a difference in where execution reads it.
Allow null: False
Example: Asia/Shanghai
How to obtain or specify: Choose an IANA time zone according to business expectations, for example Asia/Shanghai; see usage notes for current execution-side limitations.
alertOpt json Alert notification configuration object; omit on creation to save an empty configuration; pass on modification to replace the entire object. When an object is provided, aggInterval is a required validation field.
Allow null: False
Example: {"alertType": "status", "aggInterval": 0, "silentTimeout": 900, "alertTarget": []}
How to obtain or specify: Fill in according to the target structure below. Before modification, copy the complete object from details and then adjust it.
alertOpt.aggType string v2 optional mode: byFields for rule aggregation, byCluster for intelligent aggregation, byAI for AI aggregation, byCustom for custom field rule aggregation. If omitted or null, the historical aggFields logic is used; aggregation still requires aggInterval>0.
Allow null: True
Allowed values: ['byFields', 'byCluster', 'byAI', 'byCustom']
Example: byFields
How to obtain or specify: Choose the mode according to the aggregation intent.
alertOpt.ignoreOK boolean v2 optional; ignore normal severity notifications; default false.
Allow null: False
Example: false
How to obtain or specify: Use false if normal notifications are still required after recovery; use true to retain only normal events without notifying.
alertOpt.alertType string status for by severity, member for by member; omit to default to status. The targets hierarchy differs between the two modes and cannot be mixed.
Allow null: False
Allowed values: ['status', 'member']
Example: status
How to obtain or specify: Choose either recipients by severity or notification methods by member.
alertOpt.silentTimeout integer Unified repeated alert interval; omit to use the execution default of 900 seconds; 0 means no further periodic repetition in this round. Non-zero values less than 300 are executed as 300 seconds; do not pass null.
Allow null: False
Example: 900
How to obtain or specify: Enter the expected minimum repeated sending interval for similar alerts in seconds.
alertOpt.silentTimeoutByStatusEnable boolean When creation defaults to false, silentTimeout is used; when true, per-status intervals are expanded according to silentTimeoutByStatus.
Allow null: False
Example: false
How to obtain or specify: Set to true when different repetition intervals need to be set for different event severities.
alertOpt.silentTimeoutByStatus array Per-severity repetition interval array; when enabled, it should cover the severities that need to be controlled. This per-severity configuration does not go through the 300-second normalization of the unified silentTimeout.
Allow null: False
Example: [{"status": "critical,error", "silentTimeout": 600}]
How to obtain or specify: Set separately according to actual event sources and severities, using the per-severity array structure below.
alertOpt.alertTarget array Notification rule array. In status mode, put severity actions in targets; in member mode, organize members and notification methods in alertInfo.
Allow null: False
Example: [{"name": "默认通知", "targets": [{"status": "critical", "to": ["notify_example"]}]}]
How to obtain or specify: Configure the array according to business time and recipient rules; use [] when there are no actions.
alertOpt.aggInterval integer Conditionally required Required when alertOpt is provided, 0 to 1800 seconds. 0 means no aggregation; even if byAI is selected, it does not mean valid AI aggregation is enabled.
Allow null: False
$minValue: 0
$maxValue: 1800
Example: 0
How to obtain or specify: When aggregation is needed, enter the number of seconds to wait; enter 0 for no aggregation.
alertOpt.aggFields array Field list. Predefined values are df_monitor_checker_id, df_dimension_tags, df_label, CLUSTER; in byCustom mode, business custom fields can be used; for v2 aggregation modes, see also aggType.
Allow null: False
Example: ["df_monitor_checker_id"]
How to obtain or specify: Select the following fields according to which events should be grouped together; [] means aggregate all.
alertOpt.aggLabels array Array of label values for aggregation by label; when df_label is selected, a non-empty array must be provided.
Allow null: False
Example: ["production"]
How to obtain or specify: Get actual label values from event labels; use only when aggFields contains df_label.
alertOpt.aggClusterFields array Text fields for intelligent aggregation; when CLUSTER is included, at least df_title or df_message must be selected.
Allow null: False
Example: ["df_title"]
How to obtain or specify: When CLUSTER aggregation is needed, select title or content fields.
alertOpt.aggSendFirst boolean v2 optional; whether to send the first alert immediately during aggregation; default false; when aggInterval=0, it does not constitute valid aggregation.
Allow null: False
Example: false
How to obtain or specify: Set to true when the first alert should be sent immediately while aggregating.

Additional Parameter Notes

status mode configures alertTarget[].targets; member mode configures alertTarget[].alertInfo[].memberInfo and targets. For escalation recipients, use to; for notification methods, use toWay. For periodic windows, fill in crontab+crontabDuration; for specified date windows, fill in customDateUUIDs+customStartTime+customDuration. Do not use crontabDuration as customDuration.

Member mode request body structure example (submit to the URL on this page; replace the example account and team):

{
  "name": "生产服务告警",
  "ruleTimezone": "Asia/Shanghai",
  "alertOpt": {
    "alertType": "member",
    "aggInterval": 0,
    "silentTimeout": 900,
    "alertTarget": [
      {
        "name": "默认成员通知",
        "alertInfo": [
          {
            "name": "生产负责人",
            "memberInfo": [
              "acnt_example"
            ],
            "filterString": "env:production",
            "targets": [
              {
                "status": "critical",
                "to": [
                  "email"
                ],
                "upgradeTargets": [
                  {
                    "to": [
                      "group_example"
                    ],
                    "duration": 600,
                    "toWay": [
                      "email"
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "checkerUUIDs": [],
  "securityRuleUUIDs": []
}

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/alert_policy/altpl_example/modify_v2' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产服务告警","ruleTimezone":"Asia/Shanghai","alertOpt":{"alertType":"status","aggInterval":0,"silentTimeout":900,"alertTarget":[{"name":"默认通知","targets":[{"status":"critical","to":["notify_example"]}]}]},"checkerUUIDs":[],"securityRuleUUIDs":[]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.id integer or null Policy record number; may not yet be assigned in creation responses. Operations use uuid.
content.uuid string altpl_ Alert Policy UUID.
content.workspaceUUID string UUID of the Workspace to which it belongs.
content.name string Policy name.
content.desc string Policy description.
content.ruleTimezone string Time zone of the saved entity; execution read differences are described in Usage; this is not proof that the time zone is effective.
content.score integer Policy score field; defaults to 0 on creation, and this public request does not provide this field.
content.openPermissionSet boolean Custom operation permission switch.
content.permissionSet array<string> Operable role/member/team identifiers.
content.permissionSet[] string Single principal identifier.
content.status integer Record status: 0 active, 2 disabled, 3 deleted; the list includes only undeleted policies.
content.creator string Creator identity.
content.updator string Last updater identity.
content.createAt integer Creation time, Unix seconds.
content.updateAt integer Update time, Unix seconds; initially -1.
content.deleteAt integer Deletion time, Unix seconds; -1 if not deleted.
content.alertOpt object Saved configuration: alert notification configuration object; omit on creation to save an empty configuration; pass on modification to replace the entire object. When an object is provided, aggInterval is a required validation field.
content.alertOpt.alertType string Saved configuration: status for by severity, member for by member; omit to default to status. The targets hierarchy differs between the two modes and cannot be mixed.
content.alertOpt.silentTimeout integer Saved configuration: unified repeated alert interval; omit to use the execution default of 900 seconds; 0 means no further periodic repetition in this round. Non-zero values less than 300 are executed as 300 seconds; do not pass null.
content.alertOpt.silentTimeoutByStatusEnable boolean Saved configuration: when creation defaults to false, silentTimeout is used; when true, per-status intervals are expanded according to silentTimeoutByStatus.
content.alertOpt.silentTimeoutByStatus array<object> Saved configuration: per-severity repetition interval array; when enabled, it should cover the severities that need to be controlled. This per-severity configuration does not go through the 300-second normalization of the unified silentTimeout.
content.alertOpt.silentTimeoutByStatus[] object Saved configuration: per-severity interval object.
content.alertOpt.silentTimeoutByStatus[].status string Saved configuration: non-security values: fatal/critical/error/warning/nodata/info/ALL; security values: security_critical/security_high/security_medium/security_low/security_info/security_ALL. Separate multiple values with English commas without spaces.
content.alertOpt.silentTimeoutByStatus[].silentTimeout integer Saved configuration: required repetition interval for each group, in seconds. Invalid severities may trigger internal errors; validate before sending.
content.alertOpt.aggInterval integer Saved configuration: required when alertOpt is provided, 0 to 1800 seconds. 0 means no aggregation; even if byAI is selected, it does not mean valid AI aggregation is enabled.
content.alertOpt.aggFields array<string> Saved configuration: field list. Predefined values are df_monitor_checker_id, df_dimension_tags, df_label, CLUSTER; in byCustom mode, business custom fields can be used; for v2 aggregation modes, see also aggType.
content.alertOpt.aggFields[] string Saved configuration: single aggregation field. For byCustom, choose based on actual event fields; do not guess fields only from display names.
content.alertOpt.aggLabels array<string> Saved configuration: array of label values for aggregation by label; when df_label is selected, a non-empty array must be provided.
content.alertOpt.aggLabels[] string Saved configuration: single label value.
content.alertOpt.aggClusterFields array<string> Saved configuration: text fields for intelligent aggregation; when CLUSTER is included, at least df_title or df_message must be selected.
content.alertOpt.aggClusterFields[] string Saved configuration: single text field.
content.alertOpt.alertTarget array<object> Saved configuration: notification rule array. In status mode, put severity actions in targets; in member mode, organize members and notification methods in alertInfo.
content.alertOpt.alertTarget[] object Saved configuration: rule object. When a fallback is needed, explicitly add a rule without time configuration; do not assume the system fills it in automatically.
content.alertOpt.alertTarget[].name string Saved configuration: optional rule name, maximum 256 characters.
content.alertOpt.alertTarget[].crontab string Saved configuration: periodic start time expression; must be paired with crontabDuration. Choose one of this and the custom date approach.
content.alertOpt.alertTarget[].crontabDuration integer Saved configuration: duration of the periodic window in seconds; must be provided when crontab is provided; if no repetition period is configured, omit both.
content.alertOpt.alertTarget[].customDateUUIDs array<string> Saved configuration: reference to a custom date set, up to 366 items; provide it together with customStartTime and customDuration, and do not use crontabDuration as a substitute.
content.alertOpt.alertTarget[].customDateUUIDs[] string Saved configuration: single date configuration UUID.
content.alertOpt.alertTarget[].customStartTime string Saved configuration: start time on the custom date, used together with customDateUUIDs/customDuration.
content.alertOpt.alertTarget[].customDuration integer Saved configuration: duration of the custom date window in seconds; must be provided together with the date set and start time.
content.alertOpt.alertTarget[].targets array<object> Saved configuration: severity mode action array.
content.alertOpt.alertTarget[].targets[] object Saved configuration: single severity action.
content.alertOpt.alertTarget[].targets[].status string Saved configuration: required severity selection: fatal, critical, error, warning, nodata, info; use uppercase ALL for all. Separate multiple values with English commas without spaces. For the security source, use critical, high, medium, low, info, or ALL.
content.alertOpt.alertTarget[].targets[].df_source string Saved configuration: optional; the public target structure supports only security. When omitted, the execution layer excludes the security source.
content.alertOpt.alertTarget[].targets[].to array<string> Saved configuration: required recipient target array; can use members, teams, Notification Targets, or email addresses; agent accounts can use their valid default Webhook.
content.alertOpt.alertTarget[].targets[].to[] string Saved configuration: member mode commonly uses email/sms/notify_; status mode uses acnt_/agent_/group_/notify_ or email. Channel availability such as SMS depends on the site and target configuration.
content.alertOpt.alertTarget[].targets[].tags object Saved configuration: status mode filters events by field value; member mode should use the parent alertInfo.filterString, and tags here are not used as member selection conditions.
content.alertOpt.alertTarget[].targets[].tags.字段 array<string> Saved configuration: array of match values for a single field.
content.alertOpt.alertTarget[].targets[].tags.字段[] string Saved configuration: single match value.
content.alertOpt.alertTarget[].targets[].filterString string Saved configuration: in status mode, when non-empty, takes precedence over tags and is used for escalation actions; in member mode, use the parent alertInfo.filterString, and fields in this target are not valid filter entry points.
content.alertOpt.alertTarget[].targets[].upgradeTargets array<object> Saved configuration: optional escalation action; executed after the event remains at the corresponding severity for duration; [] means no escalation is configured.
content.alertOpt.alertTarget[].targets[].upgradeTargets[] object Saved configuration: single escalation action.
content.alertOpt.alertTarget[].targets[].upgradeTargets[].to array<string> Saved configuration: in member mode, these are escalation recipient members/teams; in status mode, these are escalation notification targets, which can be members/teams/Notification Targets/email addresses.
content.alertOpt.alertTarget[].targets[].upgradeTargets[].to[] string Saved configuration: single escalation recipient identifier.
content.alertOpt.alertTarget[].targets[].upgradeTargets[].duration integer Saved configuration: required duration in seconds; each escalation is configured relative to the event's continuous state, and multiple durations are not automatically accumulated.
content.alertOpt.alertTarget[].targets[].upgradeTargets[].toWay array<string> Saved configuration: member escalation notification method array; status mode does not use this field.
content.alertOpt.alertTarget[].targets[].upgradeTargets[].toWay[] string Saved configuration: single escalation notification method.
content.alertOpt.alertTarget[].alertInfo array<object> Saved configuration: member grouping array used only in member mode; status mode does not use it.
content.alertOpt.alertTarget[].alertInfo[] object Saved configuration: member grouping object.
content.alertOpt.alertTarget[].alertInfo[].name string Saved configuration: optional member group name, maximum 256 characters.
content.alertOpt.alertTarget[].alertInfo[].memberInfo array<string> Saved configuration: recipient member/team array for regular notifications in member mode, which may include agent accounts; combined with targets.to notification methods.
content.alertOpt.alertTarget[].alertInfo[].memberInfo[] string Saved configuration: single member or team identifier.
content.alertOpt.alertTarget[].alertInfo[].filterString string Saved configuration: member group-level event filter; both regular and escalation actions use this condition.
content.alertOpt.alertTarget[].alertInfo[].targets array<object> Saved configuration: notification method/severity action array in member mode.
content.alertOpt.alertTarget[].alertInfo[].targets[] object Saved configuration: single severity action.
content.alertOpt.alertTarget[].alertInfo[].targets[].status string Saved configuration: required severity selection: fatal, critical, error, warning, nodata, info; use uppercase ALL for all. Separate multiple values with English commas without spaces. For the security source, use critical, high, medium, low, info, or ALL.
content.alertOpt.alertTarget[].alertInfo[].targets[].df_source string Saved configuration: optional; the public target structure supports only security. When omitted, the execution layer excludes the security source.
content.alertOpt.alertTarget[].alertInfo[].targets[].to array<string> Saved configuration: member mode commonly uses email, sms, or notify_ Notification Targets to indicate notification methods; the execution layer also supports direct account/team targets, but it is recommended to use memberInfo combined with notification methods first.
content.alertOpt.alertTarget[].alertInfo[].targets[].to[] string Saved configuration: member mode commonly uses email/sms/notify_; status mode uses acnt_/agent_/group_/notify_ or email. Channel availability such as SMS depends on the site and target configuration.
content.alertOpt.alertTarget[].alertInfo[].targets[].tags object Saved configuration: status mode filters events by field value; member mode should use the parent alertInfo.filterString, and tags here are not used as member selection conditions.
content.alertOpt.alertTarget[].alertInfo[].targets[].tags.字段 array<string> Saved configuration: array of match values for a single field.
content.alertOpt.alertTarget[].alertInfo[].targets[].tags.字段[] string Saved configuration: single match value.
content.alertOpt.alertTarget[].alertInfo[].targets[].filterString string Saved configuration: in status mode, when non-empty, takes precedence over tags and is used for escalation actions; in member mode, use the parent alertInfo.filterString, and fields in this target are not valid filter entry points.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets array<object> Saved configuration: optional escalation action; executed after the event remains at the corresponding severity for duration; [] means no escalation is configured.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[] object Saved configuration: single escalation action.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].to array<string> Saved configuration: in member mode, these are escalation recipient members/teams; in status mode, these are escalation notification targets, which can be members/teams/Notification Targets/email addresses.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].to[] string Saved configuration: single escalation recipient identifier.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].duration integer Saved configuration: required duration in seconds; each escalation is configured relative to the event's continuous state, and multiple durations are not automatically accumulated.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].toWay array<string> Saved configuration: member escalation notification method array; status mode does not use this field.
content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].toWay[] string Saved configuration: single escalation notification method.
content.alertOpt.aggType string Saved configuration: v2 optional mode: byFields for rule aggregation, byCluster for intelligent aggregation, byAI for AI aggregation, byCustom for custom field rule aggregation. If omitted or null, the historical aggFields logic is used; aggregation still requires aggInterval>0.
content.alertOpt.ignoreOK boolean Saved configuration: v2 optional; ignore normal severity notifications; default false.
content.alertOpt.aggSendFirst boolean Saved configuration: v2 optional; whether to send the first alert immediately during aggregation; default false; when aggInterval=0, it does not constitute valid aggregation.
content.declaration object or null Workspace common declaration; write APIs return only the saved entity, without query additional fields.
{
  "code": 200,
  "content": {
    "id": 42,
    "uuid": "altpl_example",
    "workspaceUUID": "wksp_example",
    "name": "生产服务告警",
    "desc": "生产服务异常通知与升级。",
    "alertOpt": {
      "alertType": "status",
      "aggInterval": 0,
      "silentTimeout": 900,
      "alertTarget": [
        {
          "name": "默认通知",
          "targets": [
            {
              "status": "critical",
              "to": [
                "notify_example"
              ]
            }
          ]
        }
      ]
    },
    "ruleTimezone": "Asia/Shanghai",
    "score": 0,
    "openPermissionSet": false,
    "permissionSet": [],
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785430800,
    "updateAt": 1785430860,
    "deleteAt": -1,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Request JSON syntax is invalid Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError JSON top level is not an object Some json file format errors Submit a single JSON object.
400 ft.AlertPolicyNameRepeat An undeleted policy with the same name exists, or short-term concurrent creation occupied the name Alert Policy name is duplicated Query whether it has already been created first; after a short wait, confirm whether to rename and retry.
400 ft.ParamsValidateError status/member action structure or time field dependencies do not conform to rules Parameter validation failed: {} Complete the required fields according to the corresponding mode on this page; custom dates require customDuration, and do not use crontabDuration as a substitute.
400 ft.InvalidEventStatus status mode event severity is not in the corresponding ordinary/security enum Invalid event status: {} Use uppercase ALL and the correct source enum on this page, and do not include spaces between commas.
406 ft.InvalidCrontabFormat Periodic expression cannot be parsed Invalid crontab format Use a valid Cron expression and provide crontabDuration.
400 ft.ErrorFilterString filterString cannot be parsed filterString parsing failed: {} First generate a valid condition with the console filter or correct it according to the example.
400 ft.InvalidCustomNoticeDateUUID Referenced date configuration does not exist, has been deleted, or does not belong to the current Workspace Invalid custom date UUIDs: {} Obtain a valid UUID again through Custom Notification Dates.
400 ft.InvalidAggFields An aggregation field that does not meet validation is provided in a non-byCustom mode Invalid aggregation type Select according to predefined fields, or explicitly select byCustom in v2 and use actual business fields.
400 ft.TagFieldMissing df_label aggregation is selected but non-empty aggLabels is not provided Missing label Provide an array of actual label values.
400 ft.InvalidAggClusterFields CLUSTER is selected but no title or content aggregation field is provided Invalid aggregation field aggClusterFields must contain at least df_title or df_message.
400 ft.UnsupportExternalEmail A restricted Workspace version uses an external email address in a status target Free Plan Workspace does not support external email addresses as Notification Targets Select members of the current Workspace or check version and channel support.
500 ft.InternalServerError Per-severity repeated alert status equality triggers a direct exception, or saving/cache/other internal processing fails Internal error Self-check according to the enums and complete structure on this page first, query the saved state, and then decide whether to retry; if it continues to fail, provide traceId.
404 ft.NotFound Policy does not exist, has been deleted, or does not belong to the current Workspace Business route not found Obtain a valid UUID again with the Alert Policy List.
403 ft.ForbiddenAlertPolicyOperation Current identity does not pass the policy's custom operation permissions You do not have permission to operate Alert Policy [{}] Operate as the creator, owner, or authorized principal, and check permissionSet first.
403 ft.Forbidden When custom permissions are not enabled, the current identity does not have API operation permissions You do not have permission to operate Use an API Key with operation permissions.

Feedback

Is this page helpful?