Modify Notification Schedule¶
POST /api/v1/notification_schedule/{notification_schedule_uuid}/modify
Overview¶
Fully update a notification schedule along with its time period, effective period, and rotation order.
Before You Call and Usage Steps¶
First read the current configuration through Schedule Details, then provide all required fields. This operation replaces the configuration as a whole; omitting timezone resets it to Asia/Shanghai, and omitting extend clears it to {}; do not call it as a partial update. Changing the timezone, time period, notification targets, or extend resets rotationUpdateAt; changing only the name does not reset it. First obtain valid notification targets from the Notification Targets list or the Workspace Members list, and provide HH:MM time periods for the same day according to the schedule timezone. When rotation is enabled, rotationCycle must be passed, with one target per cycle in notifyTargets order; when rotation is disabled, all targets take effect together. Rotation is based on rotationUpdateAt. After a successful modification, the on-call cache for the current day is cleared; the write and subsequent processing may be completed in steps. After a timeout or 500, first query the list or details, verify the saved configuration, and then retry only the modification or cache refresh that has not yet completed. When email is used in free or Free Plan workspaces, only existing workspace member emails are supported.
Route Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| notification_schedule_uuid | string | Y | Target schedule UUID; must belong to the workspace of the current API Key. Example: nsche_exampleHow to obtain or enter: Obtain it from content.data[].uuid returned by the Schedule List. |
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 |
|---|---|---|---|
| notifyTargets[*] | string | A workspace member account UUID, notification target UUID, or email address. Example: notify_exampleHow to obtain or enter: For a member, obtain it from the account UUID in the Workspace Members list; for a notification target, obtain it from the uuid in the Notification Targets list; or enter a valid email address. All values must be strings. |
|
| extend.effectiveTime.start | integer | Effective period start in seconds; 0 or omitted means no start limit. Example: 1785427200How to obtain or enter: Provide the start boundary as Unix seconds. |
|
| extend.effectiveTime.end | integer | Effective period end in seconds; 0 or omitted means no end limit. Example: 1788019200How to obtain or enter: Provide the end boundary as Unix seconds; when non-zero, it must not be earlier than the start. |
|
| name | string | Y | Non-empty name, up to 256 characters, must be unique within the workspace. Allowed null: False Maximum length: 256 Empty string allowed: False Example: 生产值班How to obtain or enter: Check for duplicate names in the workspace using the Schedule List, then enter the name. |
| timezone | string | Schedule timezone; defaults to Asia/Shanghai when omitted. Allowed null: False Maximum length: 48 Example: Asia/ShanghaiHow to obtain or enter: Select the IANA identifier for the actual business timezone, such as Asia/Shanghai or UTC. |
|
| start | string | Y | HH:MM, from 00:00 to 23:59, and must be earlier than end. Allowed null: False Maximum length: 48 Example: 09:00How to obtain or enter: Select the daily start time according to the selected schedule timezone. |
| end | string | Y | HH:MM, must be later than start; 59 seconds are added to the end minute. For times that cross midnight, split them into separate schedules. Allowed null: False Maximum length: 48 Example: 18:00How to obtain or enter: Select the end time for the same day according to the selected schedule timezone. |
| notifyTargets | array | Y | Complete ordered string array; rotation follows this order, and an empty array means there are no notification targets. Allowed null: False Example: ["notify_example"]How to obtain or enter: For a member, obtain it from the account UUID in the Workspace Members list; for a notification target, obtain it from the uuid in the Notification Targets list; or enter a valid email address. All values must be strings. |
| extend | json | Complete extended configuration; defaults to {} when omitted. Allowed null: False Example: {"enableRotateNotification": false}How to obtain or enter: Fill in according to rotation and overall effective period requirements. |
|
| extend.enableRotateNotification | boolean | Whether to enable rotation; defaults to false. Allowed null: False Example: falseHow to obtain or enter: Use false when all targets are on call together, or true for rotating a single target. |
|
| extend.rotationCycle | string | Must be explicitly provided when rotation is enabled. day rotates by calendar day; week switches on Monday and is not based on a cumulative 7 days; month switches by calendar month; workDay rotates day by day from Monday to Friday only, and does not take effect on weekends; weekend rotates day by day on Saturday and Sunday only, and does not take effect on workdays. Public holidays are not recognized. Rotation is based on rotationUpdateAt. Allowed null: False Allowed values: ['day', 'week', 'month', 'workDay', 'weekend'] Example: dayHow to obtain or enter: Select from day, week, month, workDay, or weekend. |
|
| extend.effectiveTime | json | Overall effective period object; omitting it means permanently effective. Timestamps are in seconds, usually 10 digits, not milliseconds. Allowed null: False Example: {"start": 1785427200, "end": 1788019200}How to obtain or enter: Convert the business effective period to Unix seconds; for JavaScript Date.getTime(), divide by 1000 and round. |
Additional Parameter Notes¶
The time period includes the last second of the end minute; for example, 18:00 actually remains effective until 18:00:59. The overall effectiveTime uses Unix seconds. The example disables rotation and uses a permanent effective period; a complete rotation configuration can be added according to the parameter table.
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/notification_schedule/nsche_example/modify' \
-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":["notify_example"],"extend":{"enableRotateNotification":false}}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | object | Saved schedule entity and effective period display information; does not include notifyTargetsInfos. |
| content.id | integer | Database record number; use uuid to operate on the schedule. |
| content.uuid | string | Schedule UUID, used for query, modification, deletion, and notification policy references. |
| content.workspaceUUID | string | UUID of the workspace to which it belongs. |
| content.name | string | Schedule name. |
| content.timezone | string | IANA timezone used by this schedule to interpret the daily time period and effective dates. |
| content.start | string | Daily start time HH:MM. |
| content.end | string | Daily end time HH:MM; the last second of the end minute remains effective. |
| content.notifyTargets | array<string> |
Member, notification target UUID, or email address saved in order. |
| content.notifyTargets[] | string | acnt_ account, notify_ notification target, or email string. |
| content.extend | object | Extended configuration; may be {} when not configured. |
| content.extend.enableRotateNotification | boolean | Whether rotation is enabled; defaults to false. |
| content.extend.rotationCycle | string | Rotation cycle when rotation is enabled: day by day, week on Monday, month by calendar month, workDay daily on workdays only, weekend daily on weekends only. Public holidays are not recognized; may be omitted when not configured. |
| content.extend.effectiveTime | object | Overall effective period; may be omitted when not configured. |
| content.extend.effectiveTime.start | integer | Effective period start in Unix seconds; 0 or omitted means no limit. |
| content.extend.effectiveTime.end | integer | Effective period end in Unix seconds; 0 or omitted means no limit. |
| content.rotationUpdateAt | integer | Start time for rotation calculation, in Unix seconds. Reset when rotation-related configuration is changed. |
| content.status | integer | Record status; 0 for active records. |
| content.creator | string | Identity used for creation. |
| content.updator | string | Identity of the most recent update; empty string if not updated. |
| content.createAt | integer | Creation time, in Unix seconds. |
| content.updateAt | integer | Update time, in Unix seconds; -1 if not updated. |
| content.deleteAt | integer | Deletion time, in Unix seconds; -1 if not deleted. |
| content.effectiveTimeInfos | object | Display information for the overall effective period; returned only by list, create, and modify. |
| content.effectiveTimeInfos.timeStr | string | Formatted according to the schedule timezone as YYYY/MM/DD HH:MM:SS~YYYY/MM/DD HH:MM:SS. Empty when one side is not set; an entirely empty string when both sides are not set. |
| content.effectiveTimeInfos.expired | boolean | Whether the current time is past the end of the effective period; false when there is no end limit. |
| content.declaration | object or null | Workspace public declaration. |
{
"code": 200,
"content": {
"id": 42,
"uuid": "nsche_example",
"workspaceUUID": "wksp_example",
"name": "生产值班",
"timezone": "Asia/Shanghai",
"start": "09:00",
"end": "18:00",
"notifyTargets": [
"notify_example"
],
"extend": {
"enableRotateNotification": false
},
"rotationUpdateAt": 1785427200,
"status": 0,
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785427260,
"deleteAt": -1,
"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 | Resolution |
|---|---|---|---|---|
| 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 | Fix the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The top level of the JSON is not an object | Partial JSON file format error | Submit a single JSON object. |
| 400 | ft.InvalidStartEndTimeFromat | Daily time out of range, end time is not later than start time, etc. | Invalid time period format | Use valid HH:MM, with start earlier than end on the same day. An unparseable end format may also result in a generic 500. |
| 400 | ft.InvalidEffectiveTime | Non-zero effective period end is earlier than start | Invalid effective time | Use Unix seconds in the same unit and adjust the end boundary. |
| 406 | ft.InvalidEmail | The notification target is neither an account/notification target UUID nor a valid email address | Invalid email address | Use a real UUID or a valid email string. |
| 400 | ft.UnsupportExternalEmail | A free or Free Plan workspace used an email other than a workspace member email | Free Plan workspace does not support external email notification targets | Use an email of an existing workspace member instead, or confirm that the workspace plan supports external email addresses. |
| 400 | ft.scheduleSameNameExists | An active schedule with the same name already exists in the current workspace | A schedule with the same name already exists | Use the list to check for duplicate names, then change the name. |
| 400 | ft.MissingCustomParameters | Rotation is enabled but rotationCycle was not passed | {} field is missing | Provide a supported rotationCycle as well. |
| 500 | ft.InternalServerError | Internal failure caused by an unknown IANA timezone, invalid real date, non-string notification target, unparseable time, etc. | Internal error | Before calling, verify the timezone, real date, HH:MM, and string array against the parameter table; after a write operation fails, first query the details to confirm whether it was saved, then decide whether to retry, and retain the traceId. |
| 404 | ft.ObjectNotExists | The schedule does not exist, has been deleted, or does not belong to the current workspace | The specified object does not exist | Copy a valid UUID again from the Schedule List. |