Skip to main content
POST
Rotate Webhook Signing Key

Rotate Webhook Signing Key

POST https://api.baanx.com/v1/webhooks/{id}/rotate-key Generates a new API key for webhook signature verification and immediately invalidates the old one.

Overview

Use this endpoint when you need to rotate your webhook signing key — for example, if the key has been compromised or as part of a routine key rotation policy.
Immediate invalidation. The old API key is invalidated the moment this endpoint is called. Any in-flight webhooks that were signed with the old key will fail signature verification on your end.Save the new key immediately. The full API key is returned only once and cannot be retrieved again.

Authentication

This endpoint requires authentication via Bearer token:

Request

Headers

string
required
Bearer token for authentication

Path Parameters

string (UUID)
required
Unique identifier of the webhook configuration

Request Example

Response

200 Success

Store the apiKey from the response immediately and securely. It will not be shown again.
boolean
Indicates the key was rotated successfully
string
New full API key — store securely and update your webhook receiver immediately. The old key is now invalid.
object
Full webhook configuration. See Get Webhook for all field descriptions.

Error Responses

Key Rotation Checklist

  1. Ensure you have a secure place to store the new key (e.g., a secrets manager)
  2. Notify your team that a rotation is occurring
  3. Be prepared to update your webhook receiver immediately after rotation
  1. Immediately store the new apiKey from the response in your secrets manager
  2. Deploy the new key to your webhook receiver
  3. Verify incoming webhooks are being verified correctly with the new key
  4. Monitor your delivery logs for any signature failures
  • GET /v1/webhooks/{id} - Get current webhook configuration
  • GET /v1/webhooks/{id}/logs - Monitor delivery success after key rotation
  • POST /v1/webhooks - Create a new webhook (also returns a full key)