> ## 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}
GET /api/v1/alerts/sources/{id}/requests
```

按时间倒序返回一个[告警来源](https://docs.molesignal.com/zh-Hans/alerting/sources.md)最近收到的请求，需要 `alerts.sources.read`。每个来源保留最近 500 次请求，最长 7 天；记在处理请求的集群上。

**查询参数**

| 参数 | 类型 | 说明 |
| - | - | - |
| `limit` | integer | 最多返回几条，1 到 200，默认 50。 |

| 字段 | 说明 |
| - | - |
| `received_at` | 收到的时间（微秒）。 |
| `via_cluster` | 转来它的联邦集群；本集群直接收到的为空。 |
| `status` | `accepted`（已处理）、`rejected`（已拒收）或 `forwarded`（已转给接收集群）。 |
| `http_status` | 回给发送方的状态码。 |
| `message` | 为什么被拒，或为什么什么都没做。 |
| `alert_count` | 请求里一共几条告警。 |
| `alerts` | 每条告警的动作、去重键、标题、严重度、结果（见[接入外部告警](https://docs.molesignal.com/zh-Hans/api/alerting/send-alerts.md)）、原因和事件 ID，最多 100 条。 |
| `body_excerpt` | 被拒收的请求体开头，最多 16 KiB。 |

```bash cURL theme={null}
curl "http://localhost:5080/api/v1/alerts/sources/$SOURCE_ID/requests?limit=20" \
  -H "authorization: Bearer $MS_TOKEN"
```

```json 200 theme={null}
[
  {
    "id": "3KEJ4n3yVb1qYtq0eWQ9dUQ7mjo",
    "received_at": 1790000300000000,
    "via_cluster": "",
    "status": "accepted",
    "http_status": 200,
    "message": null,
    "alert_count": 1,
    "alerts": [
      {
        "action": "trigger",
        "dedup_key": "http://alertmanager.example.com:9093|{}:{alertname=\"HighCPU\"}",
        "summary": "HighCPU",
        "severity": "critical",
        "outcome": "opened",
        "incident_id": "3KEDNEyqouYJeBDTLTMTBui7XHW"
      }
    ],
    "body_excerpt": null
  }
]
```


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