Skip to content

Create Mute Rule



POST /api/v1/monitor/mute/create

Overview

Create an event notification mute rule for the current workspace. Single maintenance windows and recurring windows by time zone are supported.

Before You Call and Usage Steps

Determine the actual scope, then submit the complete configuration: custom uses event conditions, checker uses Monitor/SLO identifiers, alertPolicy uses Alert Policy identifiers, and tag uses Monitor tag identifiers. Ranges and event conditions together define the mute target.

For a single occurrence, use repeatTimeSet=0 and explicitly provide a finite startTime/endTime. For recurrence, use 1 and provide the complete startTime, five repeatCrontabSet fields, a positive crontabDuration, and repeatExpireTime; pass the string "0" for permanent recurrence. Omitting the expiration value does not automatically make the recurrence permanent.

The rule controls notification muting for matching events; events and monitoring data are still processed through the original flow. muteIncident is an extension capability for incident notifications and is not included in the current public write parameters; adjust it in the console if needed. Do not submit internal parameters as public request fields.

After saving, an asynchronous task updates the execution cache and rule notifications; success does not mean synchronization is completed immediately or messages have been delivered. Modifying a currently active rule may send notifications to the configured targets again, and there is no guarantee that only newly added targets are notified. After a failure, first check the rule and its effective status.

If notifyTargets is empty, no rule configuration notification is sent. When valid targets are configured, notifyMessage must also be provided; an empty notifyTimeStr indicates an immediate notification intent, and whether it is sent is constrained by the task time window and status. A single-occurrence rule without an end can execute effectively, but the current configuration notification task treats it as already ended.

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 enter: Obtain an OpenAPI Key with the required permission from API Key management in the target workspace.

Body Request Parameters

Parameter Type Required Description
muteRanges[*] json A single range object. Matching is determined by the UUID field; name/type are display information. Usually, fill only one resource key per item.
Example: {"checkerUUID": "rul_example", "name": "生产接口监控"}
How to obtain or enter: Obtain the corresponding UUID from Monitor/SLO, Alert Policy, or Monitor tag management in the same workspace; do not use display names in place of stable identifiers.
muteRanges[*].checkerUUID string Monitor UUID; commonly used for checker ranges.
Example: rul_example
How to obtain or enter: Obtain the rul_ UUID from Monitor, Smart Monitoring, or Intelligent Inspection configuration in this workspace.
muteRanges[*].sloUUID string SLO identifier, mapped at execution to the corresponding SLO detection monitor; effective only when a valid detection relationship exists.
Example: monitor_example
How to obtain or enter: Obtain the monitor_ UUID from the SLO list in this workspace.
muteRanges[*].alertPolicyUUID string Alert Policy identifier, used for alertPolicy ranges.
Example: altpl_example
How to obtain or enter: Obtain it from content.data[].uuid in the Alert Policy List.
muteRanges[*].tagUUID string Monitor tag identifier, matched at execution against event df_label by tag name.
Example: tag_example
How to obtain or enter: Obtain the tag UUID from Monitor tag management; it is not an arbitrary event field value.
muteRanges[*].name string Client display name; does not replace UUID.
Example: 生产接口监控
How to obtain or enter: Use the corresponding resource display name; optional.
muteRanges[*].type string Display type; actual range semantics are determined by the top-level type and UUID field.
Example: 监控器
How to obtain or enter: Retain the resource display type as needed by the client; optional.
tags.field array Array of actual values that this field must match.
Example: ["production"]
How to obtain or enter: Use a real event field as the key, such as env; values are recommended as an array.
tags.field[*] string A single match value; choose according to the actual data type.
Example: production
How to obtain or enter: Use the value of the same field in the event.
notifyTargets[*] json A single notification target group, using type and to.
Example: {"type": "mail", "to": ["acnt_example"]}
How to obtain or enter: For accounts, obtain acnt_ UUIDs from Workspace Members; for teams, obtain group_ UUIDs from team management in this workspace; for notification targets, obtain notify_ UUIDs from Notification Target List.
notifyTargets[*].type string Notification target type. Choose mail/notifyObject/memberGroup supported by the execution task; unknown types may be saved but may not produce valid notifications.
Example: mail
How to obtain or enter: Use mail for email accounts, notifyObject for notification targets, and memberGroup for team email.
notifyTargets[*].to array mail takes account UUIDs, notifyObject takes notification target UUIDs, and memberGroup takes team UUIDs; submit only valid resources in the same workspace.
Example: ["acnt_example"]
How to obtain or enter: For accounts, obtain acnt_ UUIDs from Workspace Members; for teams, obtain group_ UUIDs from team management in this workspace; for notification targets, obtain notify_ UUIDs from Notification Target List.
notifyTargets[*].to[*] string A single UUID of the corresponding type; do not directly use an email address as an account UUID.
Example: acnt_example
How to obtain or enter: For accounts, obtain acnt_ UUIDs from Workspace Members; for teams, obtain group_ UUIDs from team management in this workspace; for notification targets, obtain notify_ UUIDs from Notification Target List.
declaration.customField JSON Custom declaration content; does not change rule matching or authorization.
Example: MAINT-EXAMPLE
How to obtain or enter: Define field names and values according to your own business.
muteRanges array Complete range array; if omitted on creation, it defaults to []. If omitted on update, the original ranges are also cleared. For each item, fill the corresponding UUID according to the type. When custom ranges, tags, and filterString are all empty, event notifications for the entire workspace may be muted; confirm the actual scope before sending.
Null allowed: False
Example: []
How to obtain or enter: Obtain the corresponding UUID from Monitor/SLO, Alert Policy, or Monitor tag management in the same workspace; do not use display names in place of stable identifiers.
name string Rule name; explicitly provide it on create and update. If omitted on create, a short name may be generated based on range/tags/conditions; if omitted on update, the original name is retained.
Null allowed: False
Example: 生产维护静默
How to obtain or enter: Name the maintenance window according to business needs; recommended no more than 64 characters.
description string Optional description; recommended no more than 512 characters. If omitted on update, it is retained; an empty string clears it.
Null allowed: False
Empty string allowed: True
Example: 生产服务维护窗口。
How to obtain or enter: Describe the maintenance reason and impact scope.
tags json Optional field value conditions; if omitted on update, the original tags are cleared. A non-empty filterString takes precedence over tags but still combines with muteRanges.
Null allowed: False
Example: {"env": ["production"]}
How to obtain or enter: Organize from raw event field names and values, such as env, host, service, etc.
filterString string Optional event attribute conditions. The declaration allows up to 2048 characters, but the current storage capacity is shorter; recommended no more than 1024 characters. When non-empty, it takes precedence over tags; if omitted on update, it is retained, and an empty string clears it.
Null allowed: False
Empty string allowed: True
Maximum length: 2048
Example: service:checkout-api
How to obtain or enter: Fill in according to FilterString syntax; you can copy it from the event filter in the console.
notifyTargets array Optional rule configuration notification targets; these apply to notifications about the mute rule itself, not the recipients of muted alerts. On update, passing a value replaces the whole set, [] removes them, and omitting retains them.
Null allowed: False
Example: []
How to obtain or enter: For accounts, obtain acnt_ UUIDs from Workspace Members; for teams, obtain group_ UUIDs from team management in this workspace; for notification targets, obtain notify_ UUIDs from Notification Target List.
notifyMessage string Optional notification body, up to 3000 characters. On create, if any notifyTargets item contains a non-empty to, non-empty content must be provided; on update, ensure targets and content are complete.
Null allowed: False
Maximum length: 3000
Example: 生产维护静默窗口已配置。
How to obtain or enter: Fill in the notification content for the mute rule; do not include sensitive credentials.
notifyTimeStr string Optional notification time; if omitted on create or an empty string, it is treated as an immediate notification intent. If omitted on update, it is retained; an empty string changes it to immediate intent. Actual sending depends on valid targets, rule status, and time; this is not a switch to cancel notifications. For recurring rules, notifications can be sent in each cycle based on the lead time relative to the start time.
Null allowed: False
Empty string allowed: True
Example:
How to obtain or enter: Fill in YYYY/MM/DD HH:MM:SS according to the rule timezone.
startTime string Start time, YYYY/MM/DD HH:MM:SS. If omitted on create, the current time is used; if omitted when updating a single-occurrence rule, it is retained; when changing to recurrence, provide it explicitly.
Null allowed: False
Example: 2026/11/20 09:00:00
How to obtain or enter: Fill in a local time string according to the maintenance window start time and the selected timezone.
endTime string Single-occurrence end time. If omitted on create or an empty string, end=-1 is saved to indicate no end; if omitted on update, it is retained, but passing an empty string may currently return an internal error. It is recommended to explicitly provide a finite end time for single-occurrence rules.
Null allowed: False
Empty string allowed: True
Example: 2026/11/20 10:00:00
How to obtain or enter: For single-occurrence rules, fill in the actual end time, later than startTime.
repeatTimeSet int Y Required repeat mode. The actual storage is expressed through repeatExpire/crontab, and the response does not consistently return repeatTimeSet.
Null allowed: False
Example: 0
How to obtain or enter: Fill 0 for one-time only and 1 for recurring; use only these two conventional values.
repeatCrontabSet object Five-field Cron object conditionally required for repeat mode; omit for single-occurrence mode. The public declaration does not specify the object type; this document explains it according to the actual object. Missing fields may produce an invalid Cron.
Null allowed: False
Example: {"min": "0", "hour": "9", "day": "*", "month": "*", "week": "1-5"}
How to obtain or enter: In repeat mode, select the start cycle according to the rule timezone and submit the following 5 string fields completely.
repeatCrontabSet.min string When recurring, submit this field as a string: minute, 0-59. The five fields are concatenated directly, and whether any runnable time point exists is validated.
Null allowed: False
Example: 0
How to obtain or enter: Select according to Cron syntax; for example, * means all, and commas/ranges indicate multiple time points.
repeatCrontabSet.hour string When recurring, submit this field as a string: hour, 0-23. The five fields are concatenated directly, and whether any runnable time point exists is validated.
Null allowed: False
Example: 9
How to obtain or enter: Select according to Cron syntax; for example, * means all, and commas/ranges indicate multiple time points.
repeatCrontabSet.day string When recurring, submit this field as a string: day of month, 1-31 or *. The five fields are concatenated directly, and whether any runnable time point exists is validated.
Null allowed: False
Example: *
How to obtain or enter: Select according to Cron syntax; for example, * means all, and commas/ranges indicate multiple time points.
repeatCrontabSet.month string When recurring, submit this field as a string: month, 1-12 or *. The five fields are concatenated directly, and whether any runnable time point exists is validated.
Null allowed: False
Example: *
How to obtain or enter: Select according to Cron syntax; for example, * means all, and commas/ranges indicate multiple time points.
repeatCrontabSet.week string When recurring, submit this field as a string: day of week, according to the Cron week field or *. The five fields are concatenated directly, and whether any runnable time point exists is validated.
Null allowed: False
Example: 1-5
How to obtain or enter: Select according to Cron syntax; for example, * means all, and commas/ranges indicate multiple time points.
crontabDuration int Conditionally required for repeat mode; must be greater than 0. In single-occurrence mode, it does not control endTime.
Null allowed: False
Example: 3600
How to obtain or enter: Fill in a positive integer number of seconds for each mute window, for example 3600 for 1 hour.
repeatExpireTime string For repeat mode, explicitly provide 0 or a valid expiration date; omission/empty string does not equal permanent recurrence; -1 is an internal marker for single occurrence. Creating a recurrence while omitting it may be treated as a single occurrence; omitting it on update of a recurrence may cause an internal error.
Null allowed: False
Empty string allowed: True
Example: 0
How to obtain or enter: For permanent recurrence, fill the string 0; for a finite recurrence, fill YYYY/MM/DD HH:MM:SS in the timezone, and ensure it is later than the start time.
timezone str Y Required time zone for create/update, controlling local time parsing and Cron execution. Invalid time zones or time strings may return a generic internal error.
Null allowed: False
Example: Asia/Shanghai
How to obtain or enter: Use IANA time zones, such as Asia/Shanghai and UTC; time text is interpreted in that time zone.
type str Y Required type. custom is a custom event range, checker is Monitor/SLO, alertPolicy is Alert Policy, and tag is Monitor tag. Historical lists may contain monitor, but current public writes do not accept this enum.
Null allowed: False
Allowed values: ['checker', 'alertPolicy', 'tag', 'custom']
Example: custom
How to obtain or enter: Select custom/checker/alertPolicy/tag according to the mute range.
declaration json Optional rule custom declaration object. If omitted on update, it is retained; {} clears it. content.declaration in the single-rule response is this field and will no longer be overridden by the workspace public declaration.
Null allowed: False
Example: {"ticket": "MAINT-EXAMPLE"}
How to obtain or enter: The caller fills in custom rule descriptions or business tracking identifiers that need to be retained.

Additional Parameter Notes

Example recurring window request:

curl --request POST '<Endpoint>/api/v1/monitor/mute/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产维护静默","description":"生产服务维护窗口。","type":"custom","muteRanges":[],"tags":{},"filterString":"service:checkout-api","notifyTargets":[],"repeatTimeSet":1,"timezone":"Asia/Shanghai","startTime":"2026/11/20 09:00:00","repeatCrontabSet":{"min":"0","hour":"9","day":"*","month":"*","week":"1-5"},"crontabDuration":3600,"repeatExpireTime":"0"}'

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/monitor/mute/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产维护静默","description":"生产服务维护窗口。","type":"custom","muteRanges":[],"tags":{},"filterString":"service:checkout-api","notifyTargets":[],"repeatTimeSet":0,"timezone":"Asia/Shanghai","startTime":"2026/11/20 09:00:00","endTime":"2026/11/20 10:00:00"}'

Response

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

Field Type Description
content object Complete saved rule entity and formatted times; if the rule already has a declaration, no public declaration is inserted additionally.
content.id integer Rule record number; operations use uuid.
content.uuid string mute_ rule UUID.
content.workspaceUUID string Workspace to which it belongs.
content.name string Rule name.
content.description string Description.
content.type string custom/checker/alertPolicy/tag; historical records may also contain monitor.
content.tags object Saved field value conditions.
content.tags.field JSON Match values for the corresponding event field.
content.filterString string Event attribute conditions; when non-empty, takes precedence over tags.
content.muteRanges array<object> Saved range array; see the request parameters for the meaning of each UUID.
content.muteRanges[].checkerUUID string or array Monitor identifier; historical records may be an array.
content.muteRanges[].sloUUID string or array SLO identifier; historical records may be an array.
content.muteRanges[].alertPolicyUUID string Alert Policy UUID.
content.muteRanges[].tagUUID string or array Monitor tag UUID.
content.muteRanges[].name string Display name; optional.
content.muteRanges[].type string Display type; optional.
content.notifyTargets array<object> Mute rule notification targets.
content.notifyTargets[].type string mail/notifyObject/memberGroup.
content.notifyTargets[].to array<string> UUID array of the corresponding type.
content.notifyTargets[].to[] string Single target UUID.
content.notifyMessage string Mute rule notification body.
content.notifyTime integer Notification time in Unix seconds; -1 indicates immediate intent, and whether to send is still determined by the task.
content.notifyTimeStr string Notification time formatted according to timezone; empty string for immediate intent.
content.start integer Start Unix seconds.
content.end integer Single-occurrence end Unix seconds; -1 means no end.
content.startTime string YYYY/MM/DD HH:MM:SS in timezone.
content.endTime string End time in the same format; empty string when end=-1.
content.repeatExpire integer -1 for single occurrence, 0 for permanent recurrence, positive value for period expiration in Unix seconds.
content.repeatExpireTime string -1/0 or formatted expiration time in timezone.
content.crontab string Five-field Cron string for recurrence; usually empty for single occurrence.
content.crontabDuration integer Duration in seconds of each recurring window.
content.cycleNotifyAt integer Unix seconds of the most recent periodic configuration notification time; -1 if not yet notified.
content.timezone string Rule time zone.
content.declaration object Rule custom declaration, not this workspace's public declaration.
content.declaration.customField JSON Custom value saved by the caller.
content.muteIncident boolean Whether to also mute incident notifications. This write parameter is not currently declared in OpenAPI; creation defaults to false, and existing rules may reflect console settings. The alertPolicy range does not support this incident matching.
content.status integer 0 enabled, 2 disabled, 3 deleted. Enabled does not mean it is currently effective in the current period.
content.creator string Creator identity.
content.updator string Last updater identity.
content.createAt integer Creation time in Unix seconds.
content.updateAt integer Update time in Unix seconds; initially -1.
content.deleteAt integer Deletion time in Unix seconds; -1 if not deleted.
content.repeatCrontabSet object Cron reverse-parsed object provided in lists and when creating recurring rules; not consistently provided in update responses.
content.repeatCrontabSet.min string Corresponding Cron segment.
content.repeatCrontabSet.hour string Corresponding Cron segment.
content.repeatCrontabSet.day string Corresponding Cron segment.
content.repeatCrontabSet.month string Corresponding Cron segment.
content.repeatCrontabSet.week string Corresponding Cron segment.
{
  "code": 200,
  "content": {
    "id": 42,
    "uuid": "mute_example",
    "workspaceUUID": "wksp_example",
    "name": "生产维护静默",
    "description": "生产服务维护窗口。",
    "type": "custom",
    "tags": {},
    "filterString": "service:checkout-api",
    "muteRanges": [],
    "notifyTargets": [],
    "notifyMessage": "",
    "notifyTime": -1,
    "start": 1795136400,
    "end": 1795140000,
    "repeatExpire": -1,
    "cycleNotifyAt": -1,
    "crontab": "",
    "crontabDuration": 0,
    "declaration": {},
    "muteIncident": false,
    "timezone": "Asia/Shanghai",
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785430800,
    "updateAt": -1,
    "deleteAt": -1,
    "startTime": "2026/11/20 09:00:00",
    "endTime": "2026/11/20 10:00:00",
    "notifyTimeStr": "",
    "repeatExpireTime": "-1"
  },
  "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 Invalid request JSON syntax Request JSON format error Correct the JSON according to content.reason, line, and column.
400 ft.JsonFormatError JSON top level is not an object Some JSON file format error Submit a JSON object.
400 ft.muteStartEndError Single-occurrence end is not later than start, or recurring crontabDuration is not greater than 0 Mute start time must be earlier than mute end time Adjust the order and provide a positive number of seconds for recurring windows.
406 ft.InvalidCrontabFormat Cron cannot be parsed, has no runnable time point, or the scheduling check fails due to the time zone Invalid crontab format Submit all five Cron string fields and the correct timezone.
400 ft.ErrorFilterString Event attribute conditions cannot be parsed filterString parsing failed: {} Use a valid FilterString generated by the console or correct it according to the example.
406 ft.ExceedTimestampLimit Mute start/end/recurrence expiration Unix seconds exceed 2147483647 Time exceeds the 2038-01-19 limit Limit these times to before the 2038-01-19 upper bound; avoid treating milliseconds as seconds.
500 ft.InternalServerError Missing required fields for repeat mode, invalid time/time zone format, incorrect array element shape, or save/task processing failure Internal error Self-check against the complete single/recurring conditions; first check the saved rule, then decide whether to retry. If it persists, provide the traceId.
406 ft.InvalidEventData Creating a recurring rule and the positive Unix seconds converted from repeatExpireTime are not 10/13/16 digits, causing time normalization to fail Invalid event data Use a normally representable maintenance date and check the length of the positive Unix seconds; this branch occurs only when creating a recurring rule.
406 ft.MissingNotifyMessage On create, notification targets contain a non-empty to, but notifyMessage is empty Notification content is required when notification targets are selected Provide the notification body or clear the target array.

Feedback

Is this page helpful?