← 所有文档

CMS Webhook

在发布/取消发布时通知geodeck,触发llms.txt重新生成和下游ping。

端点

POST https://geodeck.icu/api/webhook/cms
X-geodeck-Signature: sha256=<hex hmac of raw body>
Content-Type: application/json

有效载荷

{
  "domain": "example.com",
  "url":    "https://example.com/blog/post-slug",
  "event":  "publish"
}

event必须是publishupdateunpublish之一。

Batch submission

{
  "domain": "example.com",
  "urls": [
    "https://example.com/blog/post-one",
    "https://example.com/blog/post-two"
  ],
  "event": "update"
}

Batch mode accepts up to 500 same-host URLs per signed request. In batch mode, omit title, summary, content, and html.

签名

使用域名的Webhook密钥计算请求正文raw的HMAC-SHA256。使用sha256=前缀十六进制编码发送。

echo -n "$BODY" | openssl dgst -sha256 -hmac "$SECRET" -hex

响应

  • 202 Accepted - 有效载荷已排队。
  • 401 Unauthorized - 签名缺失/无效。
  • 404 - 未知域名。
  • 429 - 计划速率限制已达到。

重试

收到5xx响应时,使用指数退避重试(1秒、5秒、30秒、5分钟)。第三次失败后,在CMS日志中显示错误。

Keep reading the rest of the Geodeck documentation, or jump to the platform pages.

Platform