> ## 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/incidents/{id}/severity
```

设置进行中事件的严重度，并把调用者记在 `severity_set_by`；此后规则评估不再改它。调高 `open` 事件的严重度时，从适用于新严重度的第一级重新开始升级，`escalation.reason` 是 `severity_raised`；调低，或修改已确认的事件，只改严重度。该调用需要 `alerts.incidents.update`。

**请求体**

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `severity` | string | 是 | `info`、`warning`、`error` 或 `critical`。 |

```bash cURL theme={null}
curl -X PUT http://localhost:5080/api/v1/alerts/incidents/$INCIDENT_ID/severity \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"severity": "critical"}'
```

响应是更新后的事件，各字段说明见[列出事件](https://docs.molesignal.com/zh-Hans/api/alerting/list-incidents.md)。

```json 200 theme={null}
{
  "id": "3KEDNEyqouYJeBDTLTMTBui7XHW",
  "org_id": "<organization-id>",
  "rule_id": "3KEDBLvTYO6DnWi8H9S9MNLpPT7",
  "escalation_policy_id": "<policy-id>",
  "status": "open",
  "severity": "critical",
  "summary": "High error rate · checkout",
  "fingerprint": "2b7f5329675de7077c74ffa2646a36cd3adf16f80f523270332894d1ff630632",
  "current_step": 0,
  "current_loop": 0,
  "current_step_started_at": 1790000300000000,
  "assignees": [
    "<user-id>"
  ],
  "labels": {
    "service": "checkout"
  },
  "annotations": {},
  "trace_ids": [],
  "host_ids": [],
  "affected_services": [
    "checkout"
  ],
  "created_at": 1790000000000000,
  "acknowledged_at": null,
  "acknowledged_by": null,
  "resolved_at": null,
  "resolved_by": null,
  "team_id": "<team-id>",
  "routing": {
    "reason": "default"
  },
  "snoozed_until": null,
  "snoozed_by": null,
  "assignees_pinned": false,
  "severity_set_by": "<user-id>",
  "merged_into": null,
  "dispatch_round": 1,
  "dispatch_reason": "severity_raised",
  "revision": 4
}
```

**错误**

| 状态码 | 原因 |
| - | - |
| `422` | 缺少 `severity`，或不是这四个值之一。 |
| `403` | Token 缺少 `alerts.incidents.update`，或无权访问这个事件。 |
| `404` | 事件不存在。 |
| `409` | 事件已恢复或已并入别的事件，或者更新时事件一直在变；重试即可。 |


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