Create (This API was deprecated on December 30, 2025; use the v2 version instead)¶
POST /api/v1/alert_policy/add
Overview¶
Creates notification configuration and operation permissions for an Alert Policy.
Before calling and usage steps¶
At minimum, fill in name and ruleTimezone to save an empty alert policy; to actually notify, submit a complete alertOpt, including aggInterval and the target actions for the corresponding modes. This v1 API only saves the alert policy and does not modify monitor/SLO/security rule bindings; use v2 to adjust bindings. In the current version, the top-level ruleTimezone is saved and displayed, but execution caching reads the historical alertOpt.ruleTimezone, defaulting to Asia/Shanghai; other time zones cannot be assumed to be in effect merely because the save succeeded, and integrators must verify against the actual execution time zone. Do not bypass public parameters through additional undeclared fields. Saving and cache refresh do not equal notification delivery; actual sending depends on valid targets, event levels, time windows, filtering, duplicate suppression, and the alert execution service. After a failure or timeout, first read the policy and binding status to avoid duplicate creation or mistaking partial updates.
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 fill in: obtain an OpenAPI Key with this operation permission from API Key Management in the target Workspace. |
Body request parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| permissionSet[*] | string | Identifier of a single operable subject; whether it takes effect also depends on identity and the current state of the resource. Example: wsAdminHow to obtain or fill in: use a role UUID (such as wsAdmin/general/readOnly/role_), an acnt_ account, or a group_ team; accounts/teams are subject to the actual resources in this Workspace. |
|
| alertOpt.silentTimeoutByStatus[*] | json | Graded interval object. Example: {"status": "critical,error", "silentTimeout": 600}How to obtain or fill in: each item defines a set of levels and their seconds. |
|
| alertOpt.silentTimeoutByStatus[*].status | string | For non-security, use fatal/critical/error/warning/nodata/info/ALL; for security, use security_critical/security_high/security_medium/security_low/security_info/security_ALL. Join multiple values with English commas, without spaces. Example: critical,errorHow to obtain or fill in: select from event levels; security levels use the security_ prefix, such as security_high. |
|
| alertOpt.silentTimeoutByStatus[*].silentTimeout | integer | Required repeat interval for each group, in seconds. Invalid levels may trigger internal errors; validate before sending. Example: 600How to obtain or fill in: enter a non-negative integer number of seconds for that level; 0 means no further periodic repetition. |
|
| alertOpt.aggFields[*] | string | A single aggregation field. For byCustom, select based on actual event fields; do not guess fields solely from display names. Example: df_monitor_checker_idHow to obtain or fill in: for event monitors use df_monitor_checker_id, for detection dimensions use df_dimension_tags, for labels use df_label, and for historical intelligent aggregation use CLUSTER. |
|
| alertOpt.aggLabels[*] | string | A single label value. Example: productionHow to obtain or fill in: take the actual label value from the event. |
|
| alertOpt.aggClusterFields[*] | string | A single text field. Example: df_titleHow to obtain or fill in: use df_title for the title and df_message for the 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": "Default notification", "targets": [{"status": "critical", "to": ["notify_example"]}]}How to obtain or fill in: configure each item as a time-window rule or a fallback rule without a time-window restriction. |
|
| alertOpt.alertTarget[*].name | string | Optional rule name, up to 256 characters. Example: Default notificationHow to obtain or fill in: name it by 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-5How to obtain or fill in: fill in a Cron expression for the repeat start time, such as 9 AM on weekdays; also provide crontabDuration. |
|
| alertOpt.alertTarget[*].crontabDuration | integer | Duration of the periodic window in seconds; required whenever crontab is provided; if no repeat time window is configured, omit both. Example: 28800How to obtain or fill in: 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 together with customStartTime and customDuration, and do not substitute crontabDuration. Example: ["ndate_example"]How to obtain or fill in: 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 | A single date configuration UUID. Example: ndate_exampleHow to obtain or fill in: copy a valid date configuration UUID from the same Workspace in Custom Notification Dates. |
|
| alertOpt.alertTarget[*].customStartTime | string | Start time on the custom date, used together with customDateUUIDs/customDuration. Example: 09:30:00How to obtain or fill in: fill in HH:MM:SS in the local time of the selected date; interpreted according to 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 the start time. Example: 3600How to obtain or fill in: enter a positive integer number of seconds for the window length, for example 3600 for 1 hour. |
|
| alertOpt.alertTarget[*].targets | array | Array of level-mode actions. Example: [{"status": "critical", "to": ["notify_example"]}]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*] | json | A single level action. Example: {"status": "critical", "to": ["notify_example"]}How to obtain or fill in: set one action for each event source and level. |
|
| alertOpt.alertTarget[*].targets[*].status | string | Required level selection: fatal, critical, error, warning, nodata, info, with ALL in uppercase for all; join multiple values with English commas and no spaces. For the security source, use critical, high, medium, low, info, or ALL instead. Example: criticalHow to obtain or fill in: take df_status from the actual event; 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: securityHow to obtain or fill in: fill in security only for security monitoring events; omit for ordinary events. |
|
| alertOpt.alertTarget[*].targets[*].to | array | Required array of recipient targets; members, teams, notification targets, or email addresses are supported; agent accounts may use their valid default Webhook. Example: ["notify_example"]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*].to[*] | string | In member mode, email/sms/notify_ are commonly used; in status mode, use acnt_/agent_/group_/notify_ or an email address. Whether channels such as SMS are available depends on the site and target configuration. Example: notify_exampleHow to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*].tags | json | In status mode, filter events by field value; in member mode, use the parent alertInfo.filterString instead, and tags here are not used as member selection conditions. Example: {"env": ["production"]}How to obtain or fill in: organize the dictionary from the original event fields and values. |
|
| alertOpt.alertTarget[*].targets[*].tags.Field | array | Array of matching values for a single field. Example: ["production"]How to obtain or fill in: use real event fields as keys, such as env; use an array of real field values to match as values. |
|
| alertOpt.alertTarget[*].targets[*].tags.Field[*] | string | A single matching value. Example: productionHow to obtain or fill in: take the value from the same field in the event. |
|
| alertOpt.alertTarget[*].targets[*].filterString | string | In status mode, if non-empty, takes precedence over tags and is used for upgrade actions; in member mode, use the parent alertInfo.filterString, and fields inside this target are not valid filtering entry points. Example: env:productionHow to obtain or fill in: use server-side FilterString syntax, such as env:production; for complex conditions, generate them in the console and copy them. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets | array | Optional upgrade actions; executed after the event remains at the corresponding level for duration, and [] configures no upgrade. Example: [{"to": ["acnt_example"], "duration": 600}]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*] | json | A single upgrade action. Example: {"to": ["acnt_example"], "duration": 600}How to obtain or fill in: select the recipient target and wait seconds for each upgrade. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*].to | array | In member mode, the members/teams to receive upgrades; in status mode, the upgrade notification targets, which can be members/teams/notification targets/email addresses. Example: ["acnt_example"]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*].to[*] | string | A single upgrade recipient identifier. Example: acnt_exampleHow to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*].duration | integer | Required duration in seconds; each upgrade is configured relative to the event's sustained state, and multiple durations are not automatically accumulated. Example: 600How to obtain or fill in: enter a positive integer number of seconds according to business requirements, for example 600 means the level persists for 10 minutes. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*].toWay | array | Array of member upgrade notification methods; status mode does not use this field. Example: ["email"]How to obtain or fill in: in member mode, choose from email/sms or the notify_ object in Notification Targets; in status mode, omit. |
|
| alertOpt.alertTarget[*].targets[*].upgradeTargets[*].toWay[*] | string | A single upgrade notification method. Example: emailHow to obtain or fill in: choose the actually available email/sms or notification target UUID. |
|
| alertOpt.alertTarget[*].alertInfo | array | Array of member groups used only in member mode; status mode does not use it. Example: [{"name": "Production owner", "memberInfo": ["acnt_example"], "filterString": "env:production", "targets": [{"status": "critical", "to": ["email"]}]}]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*] | json | Member group object. Example: {"name": "Production owner", "memberInfo": ["acnt_example"], "targets": [{"status": "critical", "to": ["email"]}]}How to obtain or fill in: for each group, fill in the member scope, event conditions, and notification methods. |
|
| alertOpt.alertTarget[*].alertInfo[*].name | string | Optional member group name, up to 256 characters. Example: Production ownerHow to obtain or fill in: name it by the business purpose of the member group. |
|
| alertOpt.alertTarget[*].alertInfo[*].memberInfo | array | Array of receiving members/teams for regular notifications in member mode, which may include agent accounts; combined with targets.to notification methods. Example: ["acnt_example"]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].memberInfo[*] | string | A single member or team identifier. Example: acnt_exampleHow to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].filterString | string | Member group-level event filtering; both regular and upgrade actions use this condition. Example: env:productionHow to obtain or fill in: organize from real event fields, such as env:production. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets | array | Array of notification methods/level actions in member mode. Example: [{"status": "critical", "to": ["email"]}]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*] | json | A single level action. Example: {"status": "critical", "to": ["email"]}How to obtain or fill in: set one action for each event source and level. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].status | string | Required level selection: fatal, critical, error, warning, nodata, info, with ALL in uppercase for all; join multiple values with English commas and no spaces. For the security source, use critical, high, medium, low, info, or ALL instead. Example: criticalHow to obtain or fill in: take df_status from the actual event; 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: securityHow to obtain or fill in: fill in security only for security monitoring events; omit for ordinary events. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].to | array | In member mode, email, sms, or the notify_ notification target is commonly used to indicate the notification method; the execution layer also supports direct account/team targets, and the combination of memberInfo and notification method is recommended. Example: ["email"]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].to[*] | string | In member mode, email/sms/notify_ are commonly used; in status mode, use acnt_/agent_/group_/notify_ or an email address. Whether channels such as SMS are available depends on the site and target configuration. Example: emailHow to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].tags | json | In status mode, filter events by field value; in member mode, use the parent alertInfo.filterString instead, and tags here are not used as member selection conditions. Example: {"env": ["production"]}How to obtain or fill in: organize the dictionary from the original event fields and values. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].tags.Field | array | Array of matching values for a single field. Example: ["production"]How to obtain or fill in: use real event fields as keys, such as env; use an array of real field values to match as values. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].tags.Field[*] | string | A single matching value. Example: productionHow to obtain or fill in: take the value from the same field in the event. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].filterString | string | In status mode, if non-empty, takes precedence over tags and is used for upgrade actions; in member mode, use the parent alertInfo.filterString, and fields inside this target are not valid filtering entry points. Example: env:productionHow to obtain or fill in: use server-side FilterString syntax, such as env:production; for complex conditions, generate them in the console and copy them. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets | array | Optional upgrade actions; executed after the event remains at the corresponding level for duration, and [] configures no upgrade. Example: [{"to": ["acnt_example"], "duration": 600, "toWay": ["email"]}]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*] | json | A single upgrade action. Example: {"to": ["acnt_example"], "duration": 600, "toWay": ["email"]}How to obtain or fill in: select the recipient target and wait seconds for each upgrade. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].to | array | In member mode, the members/teams to receive upgrades; in status mode, the upgrade notification targets, which can be members/teams/notification targets/email addresses. Example: ["acnt_example"]How to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].to[*] | string | A single upgrade recipient identifier. Example: acnt_exampleHow to obtain or fill in: obtain the account from content.data[].uuid in Workspace Members; obtain the team from the member's member_group or from team management as a group_ UUID; obtain the notification target from the UUID in Notification Targets. All must use real resources in the current Workspace. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].duration | integer | Required duration in seconds; each upgrade is configured relative to the event's sustained state, and multiple durations are not automatically accumulated. Example: 600How to obtain or fill in: enter a positive integer number of seconds according to business requirements, for example 600 means the level persists for 10 minutes. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].toWay | array | Array of member upgrade notification methods; status mode does not use this field. Example: ["email"]How to obtain or fill in: in member mode, choose from email/sms or the notify_ object in Notification Targets; in status mode, omit. |
|
| alertOpt.alertTarget[*].alertInfo[*].targets[*].upgradeTargets[*].toWay[*] | string | A single upgrade notification method. Example: emailHow to obtain or fill in: choose the actually available email/sms or notification target UUID. |
|
| name | string | Y | Required name of the new policy; 256 characters maximum is recommended, and avoid duplicate names within the Workspace. Null allowed: False Example: Production service alertsHow to obtain or fill in: check existing names in this Workspace from Alert Policy List and choose an unused name. |
| desc | string | Optional description, up to 256 characters. When omitted on create, it becomes an empty string; when omitted on update, it is retained; an empty string clears it. Null allowed: False Empty string allowed: True Maximum length: 256 Example: Production service anomaly notification and escalation.How to obtain or fill in: fill in according to the business scope the policy is responsible for. |
|
| openPermissionSet | boolean | Optional custom operation permission switch; defaults to false on create; if omitted on update, it is retained. When enabled, the creator, owner, and identities meeting advanced operation permissions or permissionSet can operate. Null allowed: False Example: falseHow to obtain or fill in: enable it when edit and other operations need to be restricted to specific roles, teams, or members; disable it for regular API permission control. |
|
| permissionSet | array | Complete array of custom operation subjects, which may contain role, account, and team identifiers; omitted as [] on create, and replaced as a whole when passed on update; [] clears it. The creator and owner are not locked out because of an empty array. Null allowed: False Example: ["wsAdmin"]How to obtain or fill in: obtain role UUIDs from Workspace Roles and account/team UUIDs from Workspace Members; do not fill in role display names. |
|
| ruleTimezone | str | Y | Time zone string required for both create and update, saved to the policy entity; the current public version has differences in where execution reads it. Null allowed: False Example: Asia/ShanghaiHow to obtain or fill in: choose an IANA time zone according to business expectations, such as Asia/Shanghai; see the usage notes for current execution-side limitations. |
| alertOpt | json | Alert notification configuration object; when omitted on create, an empty configuration may be saved, and it is replaced as a whole when passed on update. When an object is provided, aggInterval is a required validation field. Null allowed: False Example: {"alertType": "status", "aggInterval": 0, "silentTimeout": 900, "alertTarget": []}How to obtain or fill in: fill in according to the target structure below. Before updating, copy the complete object from the details and then adjust it. |
|
| alertOpt.alertType | string | status for by level, member for by member; if omitted, status is the default. The targets hierarchy differs between the two modes and cannot be mixed. Null allowed: False Possible values: ['status', 'member'] Example: statusHow to obtain or fill in: choose either selecting recipients by level or selecting notification methods by member. |
|
| alertOpt.alertTarget | array | Array of notification rules. In status mode, put level actions in targets; in member mode, organize members and notification methods in alertInfo. Null allowed: False Example: [{"name": "Default notification", "targets": [{"status": "critical", "to": ["notify_example"]}]}]How to obtain or fill in: configure the array by business time and receiving rules; use [] when there are no actions. |
|
| alertOpt.silentTimeout | integer | Unified repeated alert interval; if omitted, the execution default is 900 seconds; 0 means no further periodic repetition in this round. If non-zero and less than 300, execution uses 300 seconds; do not pass null. Null allowed: False Example: 900How to obtain or fill in: enter the number of seconds for the desired minimum repeated sending interval for similar alerts. |
|
| alertOpt.silentTimeoutByStatusEnable | boolean | When the default is false on create, silentTimeout is used; when true, expand per-status intervals according to silentTimeoutByStatus. Null allowed: False Example: falseHow to obtain or fill in: fill in true when different repeat intervals need to be set for different event levels. |
|
| alertOpt.silentTimeoutByStatus | array | Array of graded repeat intervals; when enabled, it should cover the levels that need control. This graded configuration does not go through the 300-second normalization of the unified silentTimeout. Null allowed: False Example: [{"status": "critical,error", "silentTimeout": 600}]How to obtain or fill in: set separately according to actual event sources and levels, using the graded array structure below. |
|
| 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. Null allowed: False $minValue: 0 $maxValue: 1800 Example: 0How to obtain or fill in: enter the number of seconds you want to wait when aggregation is needed; enter 0 for no aggregation. |
| alertOpt.aggFields | array | Field list. Predefined options include df_monitor_checker_id, df_dimension_tags, df_label, and CLUSTER; in byCustom mode, business custom fields may be used; see aggType for v2 aggregation modes. Null allowed: False Example: ["df_monitor_checker_id"]How to obtain or fill in: select the following fields according to which events you want to group 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. Null allowed: False Example: ["production"]How to obtain or fill in: obtain real 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. Null allowed: False Example: ["df_title"]How to obtain or fill in: select the title or content field when CLUSTER aggregation is needed. |
Additional parameter notes¶
In status mode, configure alertTarget[].targets; in member mode, configure alertTarget[].alertInfo[].memberInfo and targets. For upgrades, use to for recipients and toWay for notification methods. For periodic windows, fill in crontab+crontabDuration; for specified-date windows, fill in customDateUUIDs+customStartTime+customDuration, and do not treat crontabDuration as customDuration.
Example member-mode request body structure (submit to the URL on this page; replace the example accounts and teams):
{
"name": "Production service alerts",
"ruleTimezone": "Asia/Shanghai",
"alertOpt": {
"alertType": "member",
"aggInterval": 0,
"silentTimeout": 900,
"alertTarget": [
{
"name": "Default member notification",
"alertInfo": [
{
"name": "Production owner",
"memberInfo": [
"acnt_example"
],
"filterString": "env:production",
"targets": [
{
"status": "critical",
"to": [
"email"
],
"upgradeTargets": [
{
"to": [
"group_example"
],
"duration": 600,
"toWay": [
"email"
]
}
]
}
]
}
]
}
]
}
}
Request example¶
curl --request POST 'https://openapi.guance.com/api/v1/alert_policy/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"Production service alerts","ruleTimezone":"Asia/Shanghai","alertOpt":{"alertType":"status","aggInterval":0,"silentTimeout":900,"alertTarget":[{"name":"Default notification","targets":[{"status":"critical","to":["notify_example"]}]}]}}'
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; it may not yet be assigned in the create response. Operations use uuid. |
| content.uuid | string | altpl_ Alert Policy UUID. |
| content.workspaceUUID | string | UUID of the Workspace it belongs to. |
| content.name | string | Policy name. |
| content.desc | string | Policy description. |
| content.ruleTimezone | string | Saved entity time zone; see usage for execution read differences; it is not proof that the time zone is in effect. |
| content.score | integer | Policy score field; defaults to 0 on create, 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 | A single subject identifier. |
| content.status | integer | Record status: 0 active, 2 disabled, 3 deleted; the list displays policies that are not deleted. |
| content.creator | string | Creating identity. |
| content.updator | string | Most recent updating 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; when omitted on create, an empty configuration may be saved, and it is replaced as a whole when passed on update. When an object is provided, aggInterval is a required validation field. |
| content.alertOpt.alertType | string | Saved configuration: status for by level, member for by member; if omitted, status is the default. The targets hierarchy differs between the two modes and cannot be mixed. |
| content.alertOpt.silentTimeout | integer | Saved configuration: unified repeated alert interval; if omitted, the execution default is 900 seconds; 0 means no further periodic repetition in this round. If non-zero and less than 300, execution uses 300 seconds; do not pass null. |
| content.alertOpt.silentTimeoutByStatusEnable | boolean | Saved configuration: when the default is false on create, silentTimeout is used; when true, expand per-status intervals according to silentTimeoutByStatus. |
| content.alertOpt.silentTimeoutByStatus | array<object> |
Saved configuration: array of graded repeat intervals; when enabled, it should cover the levels that need control. This graded configuration does not go through the 300-second normalization of the unified silentTimeout. |
| content.alertOpt.silentTimeoutByStatus[] | object | Saved configuration: graded interval object. |
| content.alertOpt.silentTimeoutByStatus[].status | string | Saved configuration: for non-security, use fatal/critical/error/warning/nodata/info/ALL; for security, use security_critical/security_high/security_medium/security_low/security_info/security_ALL. Join multiple values with English commas, without spaces. |
| content.alertOpt.silentTimeoutByStatus[].silentTimeout | integer | Saved configuration: required repeat interval for each group, in seconds. Invalid levels 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 options include df_monitor_checker_id, df_dimension_tags, df_label, and CLUSTER; in byCustom mode, business custom fields may be used; see aggType for v2 aggregation modes. |
| content.alertOpt.aggFields[] | string | Saved configuration: a single aggregation field. For byCustom, select based on actual event fields; do not guess fields solely 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: a 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: a single text field. |
| content.alertOpt.alertTarget | array<object> |
Saved configuration: array of notification rules. In status mode, put level 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, up to 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; required whenever crontab is provided; if no repeat time window is configured, omit both. |
| content.alertOpt.alertTarget[].customDateUUIDs | array<string> |
Saved configuration: reference to a custom date set, up to 366 items; provide together with customStartTime and customDuration, and do not substitute crontabDuration. |
| content.alertOpt.alertTarget[].customDateUUIDs[] | string | Saved configuration: a 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 the start time. |
| content.alertOpt.alertTarget[].targets | array<object> |
Saved configuration: array of level-mode actions. |
| content.alertOpt.alertTarget[].targets[] | object | Saved configuration: a single level action. |
| content.alertOpt.alertTarget[].targets[].status | string | Saved configuration: required level selection: fatal, critical, error, warning, nodata, info, with ALL in uppercase for all; join multiple values with English commas and no spaces. For the security source, use critical, high, medium, low, info, or ALL instead. |
| 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 array of recipient targets; members, teams, notification targets, or email addresses are supported; agent accounts may use their valid default Webhook. |
| content.alertOpt.alertTarget[].targets[].to[] | string | Saved configuration: in member mode, email/sms/notify_ are commonly used; in status mode, use acnt_/agent_/group_/notify_ or an email address. Whether channels such as SMS are available depends on the site and target configuration. |
| content.alertOpt.alertTarget[].targets[].tags | object | Saved configuration: in status mode, filter events by field value; in member mode, use the parent alertInfo.filterString instead, and tags here are not used as member selection conditions. |
| content.alertOpt.alertTarget[].targets[].tags.Field | array<string> | Saved configuration: array of matching values for a single field. |
| content.alertOpt.alertTarget[].targets[].tags.Field[] | string | Saved configuration: a single matching value. |
| content.alertOpt.alertTarget[].targets[].filterString | string | Saved configuration: in status mode, if non-empty, takes precedence over tags and is used for upgrade actions; in member mode, use the parent alertInfo.filterString, and fields inside this target are not valid filtering entry points. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets | array<object> |
Saved configuration: optional upgrade actions; executed after the event remains at the corresponding level for duration, and [] configures no upgrade. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[] | object | Saved configuration: a single upgrade action. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[].to | array<string> |
Saved configuration: in member mode, the members/teams to receive upgrades; in status mode, the upgrade notification targets, which can be members/teams/notification targets/email addresses. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[].to[] | string | Saved configuration: a single upgrade recipient identifier. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[].duration | integer | Saved configuration: required duration in seconds; each upgrade is configured relative to the event's sustained state, and multiple durations are not automatically accumulated. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[].toWay | array<string> |
Saved configuration: array of member upgrade notification methods; status mode does not use this field. |
| content.alertOpt.alertTarget[].targets[].upgradeTargets[].toWay[] | string | Saved configuration: a single upgrade notification method. |
| content.alertOpt.alertTarget[].alertInfo | array<object> |
Saved configuration: array of member groups used only in member mode; status mode does not use it. |
| content.alertOpt.alertTarget[].alertInfo[] | object | Saved configuration: member group object. |
| content.alertOpt.alertTarget[].alertInfo[].name | string | Saved configuration: optional member group name, up to 256 characters. |
| content.alertOpt.alertTarget[].alertInfo[].memberInfo | array<string> |
Saved configuration: array of receiving members/teams 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: a single member or team identifier. |
| content.alertOpt.alertTarget[].alertInfo[].filterString | string | Saved configuration: member group-level event filtering; both regular and upgrade actions use this condition. |
| content.alertOpt.alertTarget[].alertInfo[].targets | array<object> |
Saved configuration: array of notification methods/level actions in member mode. |
| content.alertOpt.alertTarget[].alertInfo[].targets[] | object | Saved configuration: a single level action. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].status | string | Saved configuration: required level selection: fatal, critical, error, warning, nodata, info, with ALL in uppercase for all; join multiple values with English commas and no spaces. For the security source, use critical, high, medium, low, info, or ALL instead. |
| 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: in member mode, email, sms, or the notify_ notification target is commonly used to indicate the notification method; the execution layer also supports direct account/team targets, and the combination of memberInfo and notification method is recommended. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].to[] | string | Saved configuration: in member mode, email/sms/notify_ are commonly used; in status mode, use acnt_/agent_/group_/notify_ or an email address. Whether channels such as SMS are available depends on the site and target configuration. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].tags | object | Saved configuration: in status mode, filter events by field value; in member mode, use the parent alertInfo.filterString instead, and tags here are not used as member selection conditions. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].tags.Field | array<string> | Saved configuration: array of matching values for a single field. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].tags.Field[] | string | Saved configuration: a single matching value. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].filterString | string | Saved configuration: in status mode, if non-empty, takes precedence over tags and is used for upgrade actions; in member mode, use the parent alertInfo.filterString, and fields inside this target are not valid filtering entry points. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets | array<object> |
Saved configuration: optional upgrade actions; executed after the event remains at the corresponding level for duration, and [] configures no upgrade. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[] | object | Saved configuration: a single upgrade action. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].to | array<string> |
Saved configuration: in member mode, the members/teams to receive upgrades; in status mode, the upgrade notification targets, which can be members/teams/notification targets/email addresses. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].to[] | string | Saved configuration: a single upgrade recipient identifier. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].duration | integer | Saved configuration: required duration in seconds; each upgrade is configured relative to the event's sustained state, and multiple durations are not automatically accumulated. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].toWay | array<string> |
Saved configuration: array of member upgrade notification methods; status mode does not use this field. |
| content.alertOpt.alertTarget[].alertInfo[].targets[].upgradeTargets[].toWay[] | string | Saved configuration: a single upgrade notification method. |
| content.alertOpt.aggType | string | Saved configuration: v2 optional modes: byFields rule aggregation, byCluster intelligent aggregation, byAI AI aggregation, byCustom custom field rule aggregation. If omitted or null, the historical aggFields logic applies; aggregation still requires aggInterval>0. |
| content.alertOpt.ignoreOK | boolean | Saved configuration: v2 optional, ignores normal-level notifications, default false. |
| content.alertOpt.aggSendFirst | boolean | Saved configuration: v2 optional, whether to send the first item immediately during aggregation, default false; when aggInterval=0 it does not constitute valid aggregation. |
| content.declaration | object or null | Workspace public declaration; write APIs return only the saved entity without query additional fields. |
{
"code": 200,
"content": {
"id": null,
"uuid": "altpl_example",
"workspaceUUID": "wksp_example",
"name": "Production service alerts",
"desc": "",
"alertOpt": {
"alertType": "status",
"aggInterval": 0,
"silentTimeout": 900,
"alertTarget": [
{
"name": "Default notification",
"targets": [
{
"status": "critical",
"to": [
"notify_example"
]
}
]
}
]
},
"ruleTimezone": "Asia/Shanghai",
"score": 0,
"openPermissionSet": false,
"permissionSet": [],
"status": 0,
"creator": "wsak_example",
"updator": "",
"createAt": 1785430800,
"updateAt": -1,
"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 | A request field is missing, or a field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | The request JSON syntax is invalid | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The top level of the JSON is not an object | Some json file format error | Submit a single JSON object. |
| 400 | ft.AlertPolicyNameRepeat | An undeleted policy with the same name exists, or a short-term concurrent create occupied the name | Alert policy name duplicated | First query whether it has already been created; after a short wait, confirm whether to rename and retry. |
| 400 | ft.ParamsValidateError | The status/member action structure or time field dependencies do not conform to the rules | Parameter validation failed: {} | Complete the required fields according to the corresponding mode on this page; custom dates need customDuration, and do not substitute crontabDuration. |
| 400 | ft.InvalidEventStatus | In status mode, the event level is not in the corresponding ordinary/security enumeration | Invalid event status: {} | Use uppercase ALL and the correct source enumeration on this page, and do not include spaces between commas. |
| 406 | ft.InvalidCrontabFormat | The 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 valid conditions with the console filter, or correct them according to the example. |
| 400 | ft.InvalidCustomNoticeDateUUID | The 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 | In non-byCustom mode, aggregation fields that do not meet validation were provided | 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 was selected but a non-empty aggLabels was not provided | Missing label | Provide an array of actual label values. |
| 400 | ft.InvalidAggClusterFields | CLUSTER was selected but title or content aggregation fields were not provided | Invalid aggregation fields | aggClusterFields must contain at least df_title or df_message. |
| 400 | ft.UnsupportExternalEmail | A restricted Workspace version used 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 the version and channel support. |
| 500 | ft.InternalServerError | A graded repeated alert status or other equivalent value triggers a direct exception, or saving/caching/other internal processing fails | Internal error | First self-check according to the enumerations and complete structure on this page, query the saved state, and then decide whether to retry; if it continues to fail, provide the traceId. |