> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 设置团队的值班策略

> 为团队设置或去掉值班策略。

```http theme={null}
PUT /api/v1/alerts/routing/teams/{team_id}
```

设置或去掉一个团队的[值班策略](https://docs.molesignal.com/zh-Hans/alerting/routing.md#团队的值班策略)，需要 `alerts.routing.manage`。分派给这个团队的新事件按它升级；去掉后用默认策略。

| 字段 | 类型 | 说明 |
| - | - | - |
| `escalation_policy_id` | string \| null | 本组织的升级策略 ID；`null` 或不带时去掉团队的值班策略。 |

```bash cURL theme={null}
curl -X PUT http://localhost:5080/api/v1/alerts/routing/teams/$TEAM_ID \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"escalation_policy_id": "<policy-id>"}'
```

```json 200 theme={null}
{ "team_id": "<team-id>", "escalation_policy_id": "<policy-id>" }
```

**错误**

| 状态码 | 原因 |
| - | - |
| `400` | 团队不存在或属于其他组织，或升级策略不存在。 |
| `403` | Token 缺少 `alerts.routing.manage`。 |
| `422` | 带了别的字段。响应为纯文本。 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.