哪些接口需要幂等键

建议这些写操作都带 Idempotency-Key
  • POST /auth/activate
  • POST /chat/messages
  • POST /events
  • POST /content/sync
  • POST /site/jobs/next
  • POST /site/jobs/{id}/complete

命名建议

content-sync-<site-id>-<snapshot-id>-<page-number>
chat-<visitor-id>-<message-id>
job-next-<connector-run-id>
job-complete-<job-id>-<claim-token>

重试策略

const client = new GrowthOSServerConnectorClient({
  baseUrl: process.env.GROWTHOS_CONNECTOR_API_URL!,
  token: process.env.GROWTHOS_SITE_TOKEN!,
  timeoutMs: 20000,
  retries: 2
});
遇到 429RESOURCE_CONFLICT 时优先读取 Retry-After,不要盲目高频重试。