Skip to content

Create Incident Notification Schedule



POST /api/v1/incidents/schedule/add

Overview

Create incident on-call and notification escalation configurations.

Before You Call and Usage Steps

The current key requires incidents.incidentsSchedule and applies only to the current workspace. name/start/end/notifyTargets are required; notification targets may be empty, but members are not automatically filled in based on that. tagFilter accepts tag names and the response returns UUIDs; dimensionFilter uses a query string, and a match on either a tag or a dimension is sufficient; if both are empty, the schedule covers all incidents.

Create has no idempotency key, and duplicate names are rejected; on timeout/500, first query the list by name and do not create duplicates.

Within-day start/end are interpreted according to the schedule timezone and do not cross days; effectiveTime.start/end are Unix-second date boundaries. Rotation follows the order of notifyTargets and calendar periods, not fixed second lengths. Currently a new rotationUpdateAt defaults to -1, and the calculation chain treats it as a valid non-zero anchor, so enabling rotation directly does not guarantee that the schedule starts from the first member on the creation day; rotationUpdateAt cannot be passed publicly to correct this, so after creation verify the actual shifts using the details/calendar, and the anchor is reset by code only when a subsequent valid semantic modification is made. customDay/customWeek/rotationInterval/workTime can currently only appear in historical responses; public requests are rejected upfront with 406.

scheduleStrategy does not fully validate child objects; you must use consecutive level = array index, real levels/targets, and a positive repeat interval. Creation notifications take targets from the level-0 notifyConfig; a [] strategy does not automatically fall back to notifying all notifyTargets at creation time; watchkeeper must be explicitly placed in notifyObject. For incident operate=update, once the schedule's effective time and filters match, all configured notifyTargets are used and are not narrowed to the current shift by watchkeeper rotation/substitution; when an assignee exists, the assignee is notified first, then duplicates are excluded from the schedule targets—it does not only notify the assignee. Mute, channel availability, and other factors still affect actual delivery; a successful save does not prove delivery.

The schedule/new tags are committed first, and the incident matching queue is updated asynchronously afterwards; delivery failures may return 500 even though the main body has already been saved. Do not treat HTTP 200 as meaning all caches have been refreshed immediately. On failure, read back the configuration and calendar first to avoid duplicate creation; back up the complete public configuration before changes, and rollback requires resubmitting rather than guaranteeing automatic cancellation of already-sent notifications.

Request Headers

Parameter Name 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 Name Type Required Description
tagFilter[*] any A single non-empty tag name. Do not pass a tag_ UUID as an existing tag reference, otherwise it is processed as a new name; child items are not forcibly validated, so clients must use strings.
Example: production
How to obtain or fill in: The name from the tag list or a new name.
notifyTargets[*] string A single acnt_/group_/notify_ string or an email address; role IDs/Key UUIDs cannot be used, and non-string values may return 500 instead of a clear parameter error.
Example: acnt_example
How to obtain or fill in: Get acnt_ from Workspace Members, group_ from Team List, notify_ from Notification Targets List, or enter an allowed valid email address.
extend.effectiveTime.start integer Optional integer Unix seconds; omitting it/0 sets no start boundary; this differs from the within-day start time.
Example: 1785369600
How to obtain or fill in: Calculate the Unix seconds of the target date start according to the schedule timezone.
extend.effectiveTime.end integer Optional integer Unix seconds; omitting it/0 sets no end boundary; this differs from the within-day end.
Example: 1785455999
How to obtain or fill in: Calculate the Unix seconds of the deadline according to the schedule timezone.
extend.effectiveTime.custom fields any The effective period object has no per-key allowlist; other values can be saved but provide no additional execution contract.
Example: value
How to obtain or fill in: Such keys are generally unnecessary; use only start/end.
scheduleStrategy[*] json A single strategy object; the strategy uuid is used for notification deduplication caching and is not the schedule UUID.
Example: {"uuid": "strategy_payment", "name": "支付通知", "strategy": []}
How to obtain or fill in: The caller assigns a stable, unique strategy identifier and name, and avoids reusing a uuid across strategies.
scheduleStrategy[*].uuid string Used for deduplication caching by incident/strategy; do not use empty values or reuse the same value across multiple strategies.
Example: strategy_payment
How to obtain or fill in: Generated by the caller as a stable strategy UUID string that does not conflict within the workspace.
scheduleStrategy[*].name string Strategy name, displayed in notification escalation records.
Example: 支付通知
How to obtain or fill in: The caller enters the strategy display name.
scheduleStrategy[*].strategy array Array of level objects; level starts from 0, is consecutive, and matches the array index; the execution chain may index directly by level, so gaps/negative numbers are not allowed.
Example: []
How to obtain or fill in: The caller configures it in notification escalation order.
scheduleStrategy[*].strategy[*] json A single level of notification configuration; saving currently does not strictly validate leaf types.
Example: {"level": 0, "notifyConfig": [{"notifyObject": ["watchkeeper"]}], "ifRepeatNotify": false}
How to obtain or fill in: Construct it according to incident creation/escalation requirements.
scheduleStrategy[*].strategy[*].level integer 0 is the creation notification, and subsequent positive integers are escalation levels; numbering must not skip or be reordered inconsistently with the index.
Example: 0
How to obtain or fill in: Number consecutively from 0 in array order.
scheduleStrategy[*].strategy[*].levelUpTime integer For positive levels, the number of seconds to wait relative to the incident status change time; omitting it/0 uses the base level-0 selection and cannot be treated as an infinite wait.
Example: 600
How to obtain or fill in: Choose the number of seconds based on how long an incident remains unresolved before escalating.
scheduleStrategy[*].strategy[*].incidentsLevel array Array of level UUIDs to which escalation applies; the positive levelUpTime branch requires a match; this is not the P1 display name.
Example: ["system_level_1"]
How to obtain or fill in: Get uuid from Incident Level List and verify against the currently effective configuration.
scheduleStrategy[*].strategy[*].incidentsLevel[*] string A single level UUID.
Example: system_level_1
How to obtain or fill in: The uuid from the incident level list.
scheduleStrategy[*].strategy[*].incidentsStatus array Array of statuses to which escalation applies, commonly open/working; the positive levelUpTime branch requires a status match.
Example: ["open", "working"]
How to obtain or fill in: Take the incidentsStatus business status from the incident list.
scheduleStrategy[*].strategy[*].incidentsStatus[*] string A single status string.
Example: open
How to obtain or fill in: The incident business status, not database 0/2/3.
scheduleStrategy[*].strategy[*].ifRepeatNotify boolean Omitted means false; when true, a valid positive repeatNotifyInterval must be provided, because base-level calculation may take the interval modulo, and 0 fails in the job.
Example: false
How to obtain or fill in: Determines whether the same level repeats reminders.
scheduleStrategy[*].strategy[*].repeatNotifyInterval integer Repeat interval in seconds; >=60 and whole minutes are recommended; meaningful only when repeat is enabled, and 0/negative values are not allowed.
Example: 600
How to obtain or fill in: Choose a positive integer number of seconds based on reminder frequency; a positive multiple of 60 seconds is recommended.
scheduleStrategy[*].strategy[*].notifyConfig array Array of notification configuration objects; watchkeeper is replaced at runtime with the currently effective on-call person (including substitutes), not a fixed account.
Example: [{"notifyObject": ["watchkeeper"]}]
How to obtain or fill in: Construct it based on receiving targets and notification methods.
scheduleStrategy[*].strategy[*].notifyConfig[*] json A set of notification objects and optional notification methods.
Example: {"notifyObject": ["watchkeeper"]}
How to obtain or fill in: Construct it based on the real notification targets.
scheduleStrategy[*].strategy[*].notifyConfig[*].notifyObjectType string Optional display classification; the runtime chain mainly relies on notifyObject and notifyMethod and does not validate targets based on this field.
Example: member
How to obtain or fill in: You can reuse the editor display classification member/object/group.
scheduleStrategy[*].strategy[*].notifyConfig[*].notifyObject array Array of target identifiers; an empty [] does not automatically use all on-call persons—watchkeeper must be explicit.
Example: ["watchkeeper"]
How to obtain or fill in: Get acnt_ from Workspace Members, group_ from Team List, notify_ from Notification Targets List, or enter an allowed valid email address.; for the current shift, use the literal value watchkeeper.
scheduleStrategy[*].strategy[*].notifyConfig[*].notifyObject[*] string A single target or the watchkeeper placeholder.
Example: watchkeeper
How to obtain or fill in: Get acnt_ from Workspace Members, group_ from Team List, notify_ from Notification Targets List, or enter an allowed valid email address.
scheduleStrategy[*].strategy[*].notifyConfig[*].notifyMethod array Omitting it/[] uses generic target delivery, with notify_ objects following their own configuration; an explicit array selects methods, but it does not guarantee that the target has the relevant contact information set or that the site has enabled the paid channel.
Example: ["email"]
How to obtain or fill in: Choose email/mobile phone/message SMS based on the notification channels available to the target.
scheduleStrategy[*].strategy[*].notifyConfig[*].notifyMethod[*] string A single method, such as email/mobile/message, validated against the actual capabilities available in the deployment.
Example: email
How to obtain or fill in: An enabled notification method.
name string Y Required non-empty string; the declaration allows up to 256 characters, but the entity column is 128, so 1–128 is recommended; undeleted schedules in the same workspace cannot have duplicate names. Still required on modification.
Allowed null: False
Maximum length: 256
Allowed empty string: False
Example: 支付服务值班
How to obtain or fill in: The on-call maintainer enters a unique name within the workspace.
timezone string Optional string of up to 48 characters; defaults to Asia/Shanghai when omitted; omitting it on modification resets it to this default rather than preserving it. An invalid timezone may return 500 during formatting/reading, so validate it before saving.
Allowed null: False
Maximum length: 48
Example: Asia/Shanghai
How to obtain or fill in: Use an IANA timezone database identifier, such as Asia/Shanghai or UTC.
start string Y Required HH:MM within-day time, not a date or Unix time; must be earlier than end and must not cross midnight. Do not pass 24:00; split the schedule for cross-day requirements or use another management method supported by the product.
Allowed null: False
Maximum length: 48
Example: 09:00
How to obtain or fill in: Choose the daily start time according to the schedule timezone.
end string Y Required HH:MM, must be later than start, maximum 23:59; the actual working period includes the 59th second of the end minute.
Allowed null: False
Maximum length: 48
Example: 18:00
How to obtain or fill in: Choose the daily end time according to the schedule timezone.
tagFilter array Optional array of tag names; omitting it on creation means no tags, and omitting it/[] on modification clears them; the controller converts them to tag UUIDs and saves them in the response tagFilter. New tags are created with the all scope, and existing names are reused directly; the current chain does not validate the monitor scope, so do not apply the conflict rules for incident write tags. The controller allows a single name of up to 128 characters while the entity column is 64, so 1–64 is recommended.
Allowed null: False
Example: ["production"]
How to obtain or fill in: Get name (not uuid) from Tag List, or enter a new tag name.
dimensionFilter string Optional query string, not JSON/SQL/DQL; supports the project query syntax, and an invalid parse returns 400. Omitting it on creation means empty; omitting it on modification also clears it. Tag and dimension filters are matched by the runtime chain: either a tag hit or a dimension expression hit is sufficient; if both are empty, everything matches—do not mistakenly assume both must be satisfied.
Allowed null: False
Example: service:payment
How to obtain or fill in: Construct a query string from the real dimension fields and values of the incident dimensionTag.
notifyTargets array Y Required array; [] is allowed but may leave nobody to notify; saved in the original order, and the order affects shifts when rotation is enabled. Only the acnt_/notify_/group_ prefixes skip email validation; this does not guarantee that the target exists/is valid/deliverable, so verify it in the source list. Regular email addresses are checked for format, and Free Plan/free workspaces do not allow email addresses of non-workspace members. Modification replaces all entries.
Allowed null: False
Example: ["acnt_example"]
How to obtain or fill in: Get acnt_ from Workspace Members, group_ from Team List, notify_ from Notification Targets List, or enter an allowed valid email address.
extend json Optional JSON object; omitting it means {}; modification replaces the entire old public extension. Currently only the three declared keys enableRotateNotification, rotationCycle, and effectiveTime are allowed; keys read such as workTime/rotationInterval/agentUUIDs cannot be sent back and return 406 first. Modification preserves the original Agent association but removes undeclared extensions such as the old workTime, so back up and evaluate before operating.
Allowed null: False
Example: {"enableRotateNotification": false}
How to obtain or fill in: Construct it based on the rotation method and effective dates.
extend.enableRotateNotification boolean Optional boolean; omitting it means false; when true, rotationCycle must be explicitly provided, otherwise 400 MissingCustomParameters is returned.
Allowed null: False
Example: false
How to obtain or fill in: Use false when all targets are on duty simultaneously; use true to rotate in notifyTargets order.
extend.rotationCycle string Optional enum day/week/month/workDay/weekend, required when rotation is enabled. It follows the schedule timezone calendar period rather than fixed seconds; week switches on Monday, month switches on natural months, and workDay/weekend only follow weekdays and do not recognize statutory holidays. The current public declaration does not accept customDay/customWeek, and they cannot be sent back even if present in historical responses. The legacy compatible working time applies to workDay (Monday to Friday only) and weekend (Saturday and Sunday only), affecting workdays even when rotation is not enabled.
Allowed null: False
Allowed values: ['day', 'week', 'month', 'workDay', 'weekend']
Example: day
How to obtain or fill in: Choose day/week/month/workDay/weekend based on the shift.
extend.effectiveTime json Optional object; omitting it or {} means no effective date limit; it is not milliseconds or the 11-digit requirement in the older documentation. start/end can be omitted separately and take effect only when non-zero; when both are non-zero and end<start, 400 is returned. Internal subfields have no declared type validation, so be sure to use integer seconds, not strings/null or arbitrary structures.
Allowed null: False
Example: {"start": 1785369600, "end": 1785455999}
How to obtain or fill in: Convert the schedule effective date boundaries to Unix seconds, which can be calculated with timezone tools.
scheduleStrategy array Optional array of strategy objects; omitting it on creation means [], and omitting it/[] on modification clears old strategies. The current save side does not fully validate child items, so success does not prove the notification configuration is executable; the array and internal levels must be structurally correct, and validating with a minimal configuration first is recommended.
Example: []
How to obtain or fill in: Configure it in the on-call strategy editor of the current workspace and verify the JSON structure, or construct it with the fields below.

Additional Parameter Notes

Requests are governed by the public parameters on this page. The within-day start/end are HH:MM, while effective periods and substitute times are Unix seconds; see below for complete fields, value sources, response branches, and failure handling.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/incidents/schedule/add' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"支付服务值班","timezone":"Asia/Shanghai","start":"09:00","end":"18:00","notifyTargets":["acnt_example"],"dimensionFilter":"service:payment","extend":{"enableRotateNotification":false},"scheduleStrategy":[]}'

Response

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

Field Type Description
content object Schedule entity snapshot assembled before commit; it does not include the dynamic on-call summary of the list/details.
content.id integer or null Database row ID; use uuid for business identification, and the pre-commit snapshot may be null.
content.uuid string On-call UUID, with the incsch_ prefix.
content.status integer Database status, usually 0 active and 3 deleted; this is not the incident open/working status.
content.creator string Creator; for API Keys this is usually the wsak_ resource UUID.
content.updator string Most recent updater; may be empty if never updated.
content.createAt integer Creation time in Unix seconds.
content.updateAt integer Most recent update time in Unix seconds.
content.deleteAt integer Deletion time in Unix seconds; -1 if not deleted.
content.workspaceUUID string Owning workspace.
content.name string On-call name.
content.timezone string IANA timezone.
content.start string Compatible daily work start time HH:MM, interpreted according to the schedule timezone, not a date or Unix time.
content.end string Compatible daily work end time HH:MM; for effective date boundaries, see extend.effectiveTime.
content.tagFilter array<string> Array of matching tag UUIDs.
content.tagFilter[] string Tag UUID.
content.dimensionFilter string Dimension matching query expression.
content.notifyTargets array<string> List of notification target identifiers.
content.notifyTargets[] string A target identifier such as an account/group/notification target.
content.strategyConfig array<object> Escalation strategy configuration, read as the version saved in the workspace.
content.strategyConfig[] object One configuration strategy; incident read APIs do not expand the execution preview.
content.strategyConfig[].custom fields JSON Other saved strategy keys without publicly defined execution semantics.
content.extend object Schedule extension object; public requests only accept the three declared keys enableRotateNotification/rotationCycle/effectiveTime, while historical reads may contain more.
content.extend.custom fields JSON Saved on-call extension key-value pairs that cannot be modified through this API.
content.isDefault boolean Whether this is the default on-call schedule.
content.rotationUpdateAt integer Rotation anchor in Unix seconds; new schedules default to -1 and the current calculation does not automatically fall back to the creation time; the first rotation is not guaranteed to start from the first target, and it can be reset after a semantic change.
content.agentUUIDs array<string> Array of associated Agent UUIDs in the extension.
content.agentUUIDs[] string One Agent UUID.
content.strategyConfig[].uuid string Strategy UUID.
content.strategyConfig[].name string Strategy name.
content.strategyConfig[].strategy array<object> Array of escalation level configurations for this strategy.
content.strategyConfig[].strategy[].level integer Level sequence number, usually starting from 0.
content.strategyConfig[].strategy[].levelUpTime integer Escalation wait in seconds from the incident status trigger time.
content.strategyConfig[].strategy[].incidentsLevel array<string> List of applicable incident level UUIDs.
content.strategyConfig[].strategy[].incidentsLevel[] string One level UUID.
content.strategyConfig[].strategy[].incidentsStatus array<string> List of applicable incident statuses, such as open/working.
content.strategyConfig[].strategy[].incidentsStatus[] string One incident status.
content.strategyConfig[].strategy[].ifRepeatNotify boolean Whether notifications repeat.
content.strategyConfig[].strategy[].repeatNotifyInterval integer Repeat notification interval in seconds.
content.strategyConfig[].strategy[].notifyConfig array<object> Array of notification configurations for this level.
content.strategyConfig[].strategy[].notifyConfig[].notifyObjectType string Notification target classification, such as member/object/group, read as the saved version.
content.strategyConfig[].strategy[].notifyConfig[].notifyObject array<string> Notification target identifiers; watchkeeper means the current on-call person at runtime, not a fixed account UUID.
content.strategyConfig[].strategy[].notifyConfig[].notifyObject[] string One target account/group/notification target identifier or watchkeeper.
content.strategyConfig[].strategy[].notifyConfig[].notifyMethod array<string> Notification methods, commonly mobile phone/message SMS/email; object channels follow the object configuration.
content.strategyConfig[].strategy[].notifyConfig[].notifyMethod[] string One notification method.
content.extend.enableRotateNotification boolean Whether notification targets rotate.
content.extend.rotationCycle string One of day/week/month/workDay/weekend/customDay/customWeek; may be omitted in historical data.
content.extend.rotationInterval integer Rotation interval in days from 1 to 31 for customDay, and in weeks from 1 to 4 for customWeek.
content.extend.effectiveTime object Schedule effective period configuration.
content.extend.effectiveTime.start integer Saved effective start in Unix seconds; if absent, no start limit is set.
content.extend.effectiveTime.end integer Saved effective end in Unix seconds; if absent, no end limit is set.
content.extend.workTime object Working time configuration; when absent, it is derived from the compatible start/end and rotation cycle.
content.extend.workTime.mode string allDay for the whole day or specificTimes for specified times.
content.extend.workTime.periods array<object> Array of specified working time periods.
content.extend.workTime.periods[].weekdays array<integer> Applicable weekdays, 1 for Monday through 7 for Sunday.
content.extend.workTime.periods[].weekdays[] integer One of 1 to 7.
content.extend.workTime.periods[].start string Local day start HH:MM.
content.extend.workTime.periods[].end string Local day end HH:MM.
content.extend.agentUUIDs array<string> Associated Agent UUIDs; the entity also has a top-level agentUUIDs projection.
content.extend.agentUUIDs[] string One Agent UUID.
content.strategyConfig[].strategy[].notifyConfig[].notifyType JSON Display classification that older editors may retain; the runtime chain mainly reads notifyObject/notifyMethod and cannot control delivery based on this.
content.extend.effectiveTime.custom fields JSON Undeclared effective period extensions are saved as-is; clients should only use start/end.
content.effectiveTimeInfos object Effective period display added by creation/management lists; get/modify does not guarantee this field.
content.effectiveTimeInfos.timeStr string start~end formatted according to the schedule timezone; may be empty.
content.effectiveTimeInfos.expired boolean true only when an effective end exists and the current time is greater than end; false does not mean currently on shift.
content.declaration object or null Public declaration of the current workspace.
{
  "code": 200,
  "content": {
    "id": null,
    "uuid": "incsch_example",
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785427200,
    "updateAt": -1,
    "deleteAt": -1,
    "workspaceUUID": "wksp_example",
    "name": "支付服务值班",
    "timezone": "Asia/Shanghai",
    "start": "09:00",
    "end": "18:00",
    "tagFilter": [],
    "dimensionFilter": "service:payment",
    "notifyTargets": [
      "acnt_example"
    ],
    "strategyConfig": [],
    "extend": {
      "enableRotateNotification": false,
      "agentUUIDs": []
    },
    "isDefault": false,
    "rotationUpdateAt": -1,
    "agentUUIDs": [],
    "effectiveTimeInfos": {
      "timeStr": "",
      "expired": false
    },
    "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 missing, or 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 Partial JSON file format error Submit a complete schedule parameter object.
400 ft.InvalidStartEndTimeFromat Within-day time format/range invalid, or start>=end Invalid time period format Use a valid HH:MM on the same day, with start earlier than end.
400 ft.InvalidEffectiveTime Non-zero effective period end earlier than start Invalid effective time Check the Unix seconds and timezone; do not mix milliseconds.
400 ft.MissingCustomParameters extend.enableRotateNotification=true but rotationCycle missing rotationCycle field missing Provide a publicly supported cycle.
406 ft.InvalidEmail notifyTargets has no account/team/notification target prefix and the email format is invalid Invalid email address Select an identifier from the source list, or use a valid email address.
400 ft.UnsupportExternalEmail Free Plan/free workspace uses an email address of a non-workspace member Free Plan workspace, notification targets cannot be external email addresses Choose a workspace member's email address, or have the administrator confirm the product plan restriction.
400 ft.scheduleSameNameExists An undeleted schedule with the same name exists in the same workspace A schedule with the same name already exists Use a unique name; on network failure, query the list first to avoid duplicate creation.
400 ft.ParamsValidateError dimensionFilter syntax parsing failed Parameter validation failed: Field dimensionFilter is fault Change to a valid dimension query string, such as service:payment.
406 ft.ExceedMaxCharacterLimit tagFilter tag name exceeds the controller's 128-character limit {} exceeds the maximum character length limit Use a short non-empty tag name; <=64 is recommended to remain compatible with the entity column.
500 ft.InternalServerError Unhandled exceptions such as database/tag lock cache, notification substructures, invalid timezone, or post-commit queue delivery Internal error First read back the actual schedule/tag status; the main body may already be committed, and even if the queue has not converged you should not create duplicates. Keep the traceId for handling, and back up the complete configuration before modification.

Feedback

Is this page helpful?