Fig. D16 · Docs › API › Webhook 投递 签名、重试、去重 · 每用户 10 个端点
事件
  • inbox.new_message
  • inbox.message_failed
  • inbox.read
  • account.status_change
  • account.health_update
  • account.trust_changed
  • account.power_changed
  • account.presence
  • notification.new
POST 至您的 URL公网 http(s),不跟随重定向
X-TGP-Event:     inbox.new_message
X-TGP-Delivery:  82a91c75-7446-4ebe-8f79-3013cceaa1d7
X-TGP-Timestamp: 1787308800
X-TGP-Signature: v1=<hex>

{ "id", "type", "created_at",
  "data": { account_id, conversation_id,
            message { direction: in | out },
            conversation { peer_type, muted } } }
校验:v1=HMAC-SHA256(secret, "{timestamp}." + raw_body) 必须等于 X-TGP-Signature;拒绝早于几分钟的时间戳。
10 s 内任意 2xx 已投递 · 记录保留 7 天
其他响应或超时 按下方阶梯重试 · X-TGP-Delivery id 相同,据此去重
重试阶梯连续五次失败关闭端点;重新开启会重置计数
首次尝试 +10 s +1 m +5 m +30 m +2 h 失败 保留 30 天 间距不按比例
注册
POST /api/webhooks 附 url + events;events 为空即全部;响应携带签名密钥
持久性
Webhook 是持久通道;Socket.IO 流仅送达一次,离线期间错过的会丢弃
补齐
GET /api/conversations/{id}/messages?after_msg_id=… 补齐缺口,无需重读