> ## 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}
POST /api/v1/alerts/incidents
```

为规则没抓到的问题开一个事件，例如客户报障。事件带标签 `alert.source=manual`、注解 `created_by`（调用者）和 `description`（说明），`rule_id` 是 `manual`。它不经过告警流水线，每次都是新事件，不和别的事件去重，也不会自动恢复。该调用需要 `alerts.incidents.create`，并记审计 `alert.incident.created`。

**请求体**

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `title` | string | 是 | 标题，最多 200 字。 |
| `description` | string | 否 | 说明，Markdown，最多 20000 字。 |
| `severity` | string | 否 | `info`、`warning`、`error`（默认）或 `critical`。 |
| `urgency` | string | 否 | 组织某一档[紧急度](https://docs.molesignal.com/zh-Hans/alerting/on-call.md#紧急度与优先级档位)的键，例如 `high`、`low`；不给时按事件的升级策略定，见[紧急度](https://docs.molesignal.com/zh-Hans/alerting/on-call.md#紧急度)。 |
| `priority` | string | 否 | 组织的某一档优先级，默认 `P1` 到 `P5`（最多到 `P9`）。 |
| `assign` | object | 否 | 交给谁，默认 `{"kind": "auto"}`：按[告警路由](https://docs.molesignal.com/zh-Hans/alerting/routing.md)分派。`{"kind": "team", "team_id": "..."}` 用团队的值班策略；`{"kind": "policy", "escalation_policy_id": "..."}` 用这条策略；`{"kind": "users", "user_ids": [...]}` 直接通知 1 到 10 个本组织的成员，不用升级策略。 |
| `services` | string\[] | 否 | 受影响的服务，最多 20 个。 |
| `labels` | object | 否 | 标签，最多 50 个；`alert.source` 总是 `manual`。 |
| `declare_major` | boolean | 否 | 同时宣布为[重大事件](https://docs.molesignal.com/zh-Hans/alerting/major-incidents.md)。宣布不成时事件照样建好。 |

```bash cURL theme={null}
curl -X POST http://localhost:5080/api/v1/alerts/incidents \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"title": "华北区客户反馈支付页打不开", "severity": "critical", "priority": "P1", "assign": {"kind": "team", "team_id": "<team-id>"}}'
```

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

**错误**

| 状态码 | 原因 |
| - | - |
| `400` | 缺少标题或太长，标签、服务太多，`users` 不是 1 到 10 个，或团队、策略、成员不在本组织。 |
| `403` | Token 缺少 `alerts.incidents.create`。 |


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