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

在事件的[时间线](https://docs.molesignal.com/zh-Hans/api/alerting/incident-timeline.md)上添加一条备注，任何状态的事件都可以。Mole Agent 读取事件时会带上最近的备注。该调用需要 `alerts.incidents.update`。

**请求体**

| 字段 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `text` | string | 是 | 1 到 4000 个字符，去掉首尾空白后计算。 |

```bash cURL theme={null}
curl -X POST http://localhost:5080/api/v1/alerts/incidents/$INCIDENT_ID/notes \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"text": "Rolled back the edge proxy."}'
```

响应是这条备注在时间线上的记录。

```json 200 theme={null}
{
  "id": "3KEE1aXy7pRtGd2s9Lm4Qv8bNcE",
  "org_id": "<organization-id>",
  "incident_id": "3KEDNEyqouYJeBDTLTMTBui7XHW",
  "at": 1790000300000000,
  "kind": "note",
  "actor": "<user-id>",
  "detail": {
    "text": "Rolled back the edge proxy.",
    "via": "api"
  }
}
```

**错误**

| 状态码 | 原因 |
| - | - |
| `400` | `text` 为空或超过 4000 个字符。 |
| `403` | Token 缺少 `alerts.incidents.update`，或无权访问这个事件。 |
| `404` | 事件不存在。 |


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