Rotate webhook endpoint secret
POST/api/v1/sdk/stores/:storeId/webhooks/:webhookId/rotate-secret
This endpoint generates a new webhook secret for signature verification. Use this to rotate secrets periodically for security or if a secret is compromised.
Authentication: Requires Private API Key (sk_*) with Administer permission
Rotation Behavior:- New secret is generated immediately
- Old secret becomes invalid
- All future webhook deliveries use new secret
- New secret is only shown ONCE in response
- Webhook continues receiving events without interruption
- New webhook secret (string, 32+ characters)
- Rotation timestamp (ISO 8601)
- Regular security secret rotation
- Responding to secret compromise
- Resetting forgotten secrets
- Implementing secret rotation policies
- CRITICAL: Store the returned secret securely immediately
- Secret cannot be retrieved again after this response
- Update your webhook verification code with new secret
- Old secret stops working immediately
- Consider testing webhook after rotation to verify new secret works
- Rotate secrets every 90-180 days
- Rotate immediately if secret may be compromised
- Store secrets in secure environment variables or secret management
- Never commit secrets to source control
- 404 NOT FOUND - Webhook or store not found (Error code: WEBHOOK_NOT_FOUND or STORE_NOT_FOUND)
- 401 UNAUTHORIZED - Invalid or missing API key (Error code: INVALID_API_KEY)
- 403 FORBIDDEN - Insufficient permissions (Error code: INSUFFICIENT_PERMISSIONS)
Request​
Responses​
- 200
- 400
- 401
- 403
- 404
- 500
Secret rotated successfully - STORE THE NEW SECRET IMMEDIATELY
Bad Request
Unauthorized - Invalid or missing API key
Forbidden - Insufficient permissions
Webhook or store not found
Internal server error