Generate a new webhook signing secret
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
Replaces the domain's webhook signing secret with a new random
whsec_… value and returns it. Deliveries are signed with the new
secret from the next one on, so the old secret stops verifying at once
— update your receiver first. Requires domain.settings.
Query parameters
- domainstringrequiredquery
The domain name (for example
example.com). These endpoints take the domain as a query parameter rather than a path segment.
Responses
200The webhook, with its new secret.
Content type: application/json
- enabledboolean
- urlstring
Empty when no webhook is configured.
- secretstring
The HMAC signing secret,
whsec_…. Empty until a URL has been saved.
{
"enabled": true,
"url": "string",
"secret": "string"
}400The domain query parameter is missing.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "domain is required"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}403The key is read-only, your role on the domain lacks the required permission, or the domain's plan does not include the feature.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}Example request
curl -X POST "https://api.nsin.ir/uptime/webhook/rotate-secret?domain=example.com" \
-H "Authorization: Bearer $NSIN_API_KEY"