Skip to content
nsin docs

Generate a new webhook signing secret

POST
/uptime/webhook/rotate-secret
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.

domain
required
string

The domain name (for example example.com). These endpoints take the domain as a query parameter rather than a path segment.

Example
example.com

The webhook, with its new secret.

Media type application/json
object
enabled
boolean
url

Empty when no webhook is configured.

string
secret

The HMAC signing secret, whsec_…. Empty until a URL has been saved.

string
Example generated
{
"enabled": true,
"url": "example",
"secret": "example"
}

The domain query parameter is missing.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example missing
{
"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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}