更新值班表
curl --request POST \
--url 'https://api.flashcat.cloud/schedule/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"schedule_id": 5789640530410,
"schedule_name": "Production On-Call",
"description": "Primary on-call rotation for the production team",
"team_id": 4291079133131,
"status": 0,
"layers": [
{
"layer_name": "Layer 1",
"mode": 0,
"groups": [
{
"group_name": "A",
"members": [
{
"role_id": 0,
"person_ids": [
2451002751131
]
}
]
},
{
"group_name": "B",
"members": [
{
"role_id": 0,
"person_ids": [
2476123212131
]
}
]
}
],
"rotation_unit": "day",
"rotation_value": 1,
"starts_at": {
"date": "2026-04-13",
"time": "09:00"
},
"restrict_mode": 0,
"day_mask": {
"repeat": [
1,
2,
3,
4,
5
]
},
"fair_rotation": false,
"mask_continuous_enabled": false
}
]
}
'import requests
url = "https://api.flashcat.cloud/schedule/update?app_key="
payload = {
"schedule_id": 5789640530410,
"schedule_name": "Production On-Call",
"description": "Primary on-call rotation for the production team",
"team_id": 4291079133131,
"status": 0,
"layers": [
{
"layer_name": "Layer 1",
"mode": 0,
"groups": [
{
"group_name": "A",
"members": [
{
"role_id": 0,
"person_ids": [2451002751131]
}
]
},
{
"group_name": "B",
"members": [
{
"role_id": 0,
"person_ids": [2476123212131]
}
]
}
],
"rotation_unit": "day",
"rotation_value": 1,
"starts_at": {
"date": "2026-04-13",
"time": "09:00"
},
"restrict_mode": 0,
"day_mask": { "repeat": [1, 2, 3, 4, 5] },
"fair_rotation": False,
"mask_continuous_enabled": False
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schedule_id: 5789640530410,
schedule_name: 'Production On-Call',
description: 'Primary on-call rotation for the production team',
team_id: 4291079133131,
status: 0,
layers: [
{
layer_name: 'Layer 1',
mode: 0,
groups: [
{group_name: 'A', members: [{role_id: 0, person_ids: [2451002751131]}]},
{group_name: 'B', members: [{role_id: 0, person_ids: [2476123212131]}]}
],
rotation_unit: 'day',
rotation_value: 1,
starts_at: {date: '2026-04-13', time: '09:00'},
restrict_mode: 0,
day_mask: {repeat: [1, 2, 3, 4, 5]},
fair_rotation: false,
mask_continuous_enabled: false
}
]
})
};
fetch('https://api.flashcat.cloud/schedule/update?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/schedule/update?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'schedule_id' => 5789640530410,
'schedule_name' => 'Production On-Call',
'description' => 'Primary on-call rotation for the production team',
'team_id' => 4291079133131,
'status' => 0,
'layers' => [
[
'layer_name' => 'Layer 1',
'mode' => 0,
'groups' => [
[
'group_name' => 'A',
'members' => [
[
'role_id' => 0,
'person_ids' => [
2451002751131
]
]
]
],
[
'group_name' => 'B',
'members' => [
[
'role_id' => 0,
'person_ids' => [
2476123212131
]
]
]
]
],
'rotation_unit' => 'day',
'rotation_value' => 1,
'starts_at' => [
'date' => '2026-04-13',
'time' => '09:00'
],
'restrict_mode' => 0,
'day_mask' => [
'repeat' => [
1,
2,
3,
4,
5
]
],
'fair_rotation' => false,
'mask_continuous_enabled' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/schedule/update?app_key="
payload := strings.NewReader("{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/schedule/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/schedule/update?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "AccessDenied",
"message": "Access Denied."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}值班排班
更新值班表
更新 schedule_id 指定的值班表;分层列表整体替换。
POST
/
schedule
/
update
更新值班表
curl --request POST \
--url 'https://api.flashcat.cloud/schedule/update?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"schedule_id": 5789640530410,
"schedule_name": "Production On-Call",
"description": "Primary on-call rotation for the production team",
"team_id": 4291079133131,
"status": 0,
"layers": [
{
"layer_name": "Layer 1",
"mode": 0,
"groups": [
{
"group_name": "A",
"members": [
{
"role_id": 0,
"person_ids": [
2451002751131
]
}
]
},
{
"group_name": "B",
"members": [
{
"role_id": 0,
"person_ids": [
2476123212131
]
}
]
}
],
"rotation_unit": "day",
"rotation_value": 1,
"starts_at": {
"date": "2026-04-13",
"time": "09:00"
},
"restrict_mode": 0,
"day_mask": {
"repeat": [
1,
2,
3,
4,
5
]
},
"fair_rotation": false,
"mask_continuous_enabled": false
}
]
}
'import requests
url = "https://api.flashcat.cloud/schedule/update?app_key="
payload = {
"schedule_id": 5789640530410,
"schedule_name": "Production On-Call",
"description": "Primary on-call rotation for the production team",
"team_id": 4291079133131,
"status": 0,
"layers": [
{
"layer_name": "Layer 1",
"mode": 0,
"groups": [
{
"group_name": "A",
"members": [
{
"role_id": 0,
"person_ids": [2451002751131]
}
]
},
{
"group_name": "B",
"members": [
{
"role_id": 0,
"person_ids": [2476123212131]
}
]
}
],
"rotation_unit": "day",
"rotation_value": 1,
"starts_at": {
"date": "2026-04-13",
"time": "09:00"
},
"restrict_mode": 0,
"day_mask": { "repeat": [1, 2, 3, 4, 5] },
"fair_rotation": False,
"mask_continuous_enabled": False
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
schedule_id: 5789640530410,
schedule_name: 'Production On-Call',
description: 'Primary on-call rotation for the production team',
team_id: 4291079133131,
status: 0,
layers: [
{
layer_name: 'Layer 1',
mode: 0,
groups: [
{group_name: 'A', members: [{role_id: 0, person_ids: [2451002751131]}]},
{group_name: 'B', members: [{role_id: 0, person_ids: [2476123212131]}]}
],
rotation_unit: 'day',
rotation_value: 1,
starts_at: {date: '2026-04-13', time: '09:00'},
restrict_mode: 0,
day_mask: {repeat: [1, 2, 3, 4, 5]},
fair_rotation: false,
mask_continuous_enabled: false
}
]
})
};
fetch('https://api.flashcat.cloud/schedule/update?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/schedule/update?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'schedule_id' => 5789640530410,
'schedule_name' => 'Production On-Call',
'description' => 'Primary on-call rotation for the production team',
'team_id' => 4291079133131,
'status' => 0,
'layers' => [
[
'layer_name' => 'Layer 1',
'mode' => 0,
'groups' => [
[
'group_name' => 'A',
'members' => [
[
'role_id' => 0,
'person_ids' => [
2451002751131
]
]
]
],
[
'group_name' => 'B',
'members' => [
[
'role_id' => 0,
'person_ids' => [
2476123212131
]
]
]
]
],
'rotation_unit' => 'day',
'rotation_value' => 1,
'starts_at' => [
'date' => '2026-04-13',
'time' => '09:00'
],
'restrict_mode' => 0,
'day_mask' => [
'repeat' => [
1,
2,
3,
4,
5
]
],
'fair_rotation' => false,
'mask_continuous_enabled' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/schedule/update?app_key="
payload := strings.NewReader("{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/schedule/update?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/schedule/update?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"schedule_id\": 5789640530410,\n \"schedule_name\": \"Production On-Call\",\n \"description\": \"Primary on-call rotation for the production team\",\n \"team_id\": 4291079133131,\n \"status\": 0,\n \"layers\": [\n {\n \"layer_name\": \"Layer 1\",\n \"mode\": 0,\n \"groups\": [\n {\n \"group_name\": \"A\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2451002751131\n ]\n }\n ]\n },\n {\n \"group_name\": \"B\",\n \"members\": [\n {\n \"role_id\": 0,\n \"person_ids\": [\n 2476123212131\n ]\n }\n ]\n }\n ],\n \"rotation_unit\": \"day\",\n \"rotation_value\": 1,\n \"starts_at\": {\n \"date\": \"2026-04-13\",\n \"time\": \"09:00\"\n },\n \"restrict_mode\": 0,\n \"day_mask\": {\n \"repeat\": [\n 1,\n 2,\n 3,\n 4,\n 5\n ]\n },\n \"fair_rotation\": false,\n \"mask_continuous_enabled\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "AccessDenied",
"message": "Access Denied."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 300 次/分钟;20 次/秒 |
| 权限要求 | 值班管理(on-call) |
使用说明
layers总是整体替换:请把要保留的分层全部传入。不传layers(或传空数组)会删除所有分层。- 未传的
schedule_name、description、team_id、notify和status保持原值。传入的notify会整体替换通知配置;但留空的密钥(im值、webhook 的token、verify_token、sign_secret)保留已保存的值,按类型、别名和数据源匹配。 - 更新时旧字段
name和disabled不生效;改名请用schedule_name,启用/禁用请用status(0启用,1禁用)。 time_zone不可修改:不传或传当前值;传入其他值会被拒绝。分层的墙钟字段按已保存的时区换算。- 每次调用都会记录到账户审计日志。
- 调用者必须能编辑该值班表(账户所有者或管理员、创建者或其团队成员);移动到其他团队时还须属于目标团队,所有者和管理员除外。否则返回
AccessDenied。 - 不属于本账户的成员 ID 或 IM 数据源返回
InvalidParameter;新增 IM 应用目标可能返回NoLicense。值班表上已保存的引用不会重新校验。
授权
请求体
application/json
/schedule/create、/schedule/update、/schedule/preview 的请求体。创建时必须提供 schedule_name(或旧字段 name),更新时必须提供 schedule_id,预览时必须提供 start/end。
此页面对您有帮助吗?