重投一条投递
POST
/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/redeliver重新发送一条已结束(delivered 或 failed)的投递。会新建并返回一条投递记录,原记录保留。
鉴权
请求头携带 Authorization: Bearer <API_KEY>。API Key 的可访问资源由当前授权范围决定。
请求
Base URL:https://api.bluehola.com
参数
| 名称 | 位置 | 必填 | 类型/约束 | 说明 |
|---|---|---|---|---|
id | path | 是 | string | 回调端点 ID,whe_... |
deliveryId | path | 是 | string | 要重新发送的投递,wd_...,从查看投递记录获取 |
无请求体。
响应
| 状态码 | 说明 |
|---|---|
202 | 已受理——新投递已排队 |
4xx | 客户端错误 |
202 响应 Schema
新的投递记录,形状与查看投递记录的一条 item 相同;其 redeliveredFrom 为原投递的 ID。
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"endpointId": {
"type": "string"
},
"eventId": {
"type": [
"string",
"null"
]
},
"eventType": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"pending",
"queued",
"delivered",
"failed"
]
},
"attempts": {
"type": "integer"
},
"responseStatus": {
"type": [
"integer",
"null"
]
},
"responseBodyPreview": {
"type": [
"string",
"null"
]
},
"lastError": {
"type": [
"string",
"null"
]
},
"nextRetryAt": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"redeliveredFrom": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"completedAt": {
"type": [
"string",
"null"
],
"format": "date-time"
}
}
}
通用错误信封及处理建议见错误码。
错误
| 状态码 | details.reason | 含义 |
|---|---|---|
409 | delivery_in_progress | 原投递尚未结束(pending / queued),它会自己继续重试 |
409 | endpoint_not_active | 端点不是 active;请先重新启用或完成验证 |
409 | redelivery_in_progress | 同一事件已有一次进行中的重投 |
404 | — | 该投递不属于路径中的端点 |
补充说明
用于找回接收端故障期间错过的事件——自动重试约 38.6 小时后会放弃(见 Webhook 集成)。202 只表示重投已排队,结果请在查看投递记录中确认。
- 重投发往端点当前的 URL,并用当前的密钥签名,所以轮换密钥之后也能验签通过。
- 去重: 连接协议下,重投与原投递携带相同的
Webhook-Id,接收方可以据此去重。默认方案下X-Delivery-Id是新投递的 ID;如果重投的事件可能已经被接收方处理过,请按事件内容去重(例如消息的id/wamid)。 - 原投递记录不会被修改。