Generate a new webhook signing secret
const url = 'https://api.nsin.ir/uptime/webhook/rotate-secret?domain=example.com';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.nsin.ir/uptime/webhook/rotate-secret?domain=example.com' \ --header 'Authorization: Bearer <token>'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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The domain name (for example example.com). These endpoints take the
domain as a query parameter rather than a path segment.
Example
example.comResponses
Section titled “ Responses ”The webhook, with its new secret.
object
Empty when no webhook is configured.
The HMAC signing secret, whsec_…. Empty until a URL has been saved.
Example generated
{ "enabled": true, "url": "example", "secret": "example"}The domain query parameter is missing.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "domain is required"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}