跳转到主要内容
POST
/
channel
/
escalate
/
rule
/
create
策略创建
curl --request POST \
  --url 'https://api.flashcat.cloud/channel/escalate/rule/create?app_key=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "channel_id": 123,
  "rule_name": "<string>",
  "template_id": "<string>",
  "layers": [
    {
      "max_times": 123,
      "notify_step": 123,
      "escalate_window": 123,
      "target": {
        "team_ids": [
          123
        ],
        "person_ids": [
          123
        ],
        "schedule_to_role_ids": {
          "{schedule_id}": [
            123
          ]
        },
        "by": {
          "critical": [
            "email"
          ],
          "warning": [
            "email"
          ],
          "info": [
            "email"
          ],
          "follow_preference": true
        },
        "webhooks": [
          {
            "type": "feishu_app",
            "settings": {
              "data_source_id": 123,
              "chat_ids": "<string>",
              "reply_mode": "threads",
              "reply_event_types": [
                "<string>"
              ],
              "disable_at": true,
              "put_top_notice": true,
              "severities": [
                "Info"
              ]
            }
          }
        ]
      },
      "force_escalate": true
    }
  ],
  "aggr_window": 123,
  "description": "<string>",
  "time_filters": [
    {
      "start": "<string>",
      "end": "<string>",
      "repeat": [
        0
      ],
      "cal_id": "<string>",
      "is_off": true
    }
  ],
  "filters": [
    [
      {
        "key": "title",
        "oper": "IN",
        "vals": [
          "<string>"
        ]
      }
    ]
  ]
}
'
{
  "error": {
    "code": "<string>",
    "message": "<string>"
  },
  "data": {
    "rule_id": "<string>",
    "rule_name": "<string>"
  }
}

授权

app_key
string
query
必填

请求头

Content-Type
string

请求体

application/json
channel_id
integer
必填
rule_name
string
必填
template_id
string
必填

默认为系统预置模板

layers
分派环节 · object[]
必填
aggr_window
integer
必填
description
string
time_filters
时间条件 · object[]
filters
object[][]

响应

200 - application/json
error
object

错误信息,仅失败时存在

data
object