Skip to main content
POST
/
api
/
v1
/
webhooks
/
subscriptions
/
{subscription_id}
/
rotate-secret
curl --request POST \
  --url https://hpay-api.host-sl.com/api/v1/webhooks/subscriptions/7c1d2e3f-.../rotate-secret \
  --header 'api-key: YOUR_API_KEY' \
  --header 'secret-key: YOUR_SECRET_KEY'
{
  "id": "a1b2c3d4-...",
  "secret": "whsec_new5e6f7...",
  "secret_preview": "...7Xw2",
  "rotated_from_id": "9z8y7x6w-..."
}
Generates a new signing secret for the subscription and retires the old one. Update your endpoint’s verification secret immediately after rotating.
The new secret is returned only in this response — store it before discarding the old one.

Path Parameters

subscription_id
string
required
The subscription whose secret to rotate.

Response

id
string
The new secret’s ID.
secret
string
The new signing secret — shown once.
secret_preview
string
The last few characters, for identification.
rotated_from_id
string
The ID of the secret this one replaced.
{
  "id": "a1b2c3d4-...",
  "secret": "whsec_new5e6f7...",
  "secret_preview": "...7Xw2",
  "rotated_from_id": "9z8y7x6w-..."
}
curl --request POST \
  --url https://hpay-api.host-sl.com/api/v1/webhooks/subscriptions/7c1d2e3f-.../rotate-secret \
  --header 'api-key: YOUR_API_KEY' \
  --header 'secret-key: YOUR_SECRET_KEY'