Skip to content
nsin docs

Update outage-detection settings

PUT
/uptime/settings
curl --request PUT \
--url 'https://api.nsin.ir/uptime/settings?domain=example.com' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "enabled": true, "threshold_pct": 1, "window_min": 1, "min_requests": 1, "min_active_min": 1, "recover_min": 1, "uptime_host_match_type": "", "uptime_host_includes": [ "example" ], "uptime_host_excludes": [ "example" ], "notify_email": true, "notify_sms": true, "notify_webhook": true, "webhook_url": "example" }'

Partial update — omitted fields keep their current value. Values are clamped to the ranges reported in bounds. Requires domain.settings (not analytics read access: retuning detection is a settings change).

Narrowing uptime_host_includes / uptime_host_excludes can strand an open incident on a subdomain that is no longer watched. The detector closes it on its next tick, without a recovery notification.

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
Media type application/json

Every field is optional; omitted fields keep their current value.

object
enabled

Outage alerts on or off for the domain.

boolean
threshold_pct

Per-minute origin-error percentage that counts as down (see bounds).

integer
window_min

Minutes the error rate must stay above the threshold before an incident opens.

integer
min_requests

Minimum origin-eligible requests in the window before an incident can open.

integer
min_active_min

Minimum one-minute buckets with traffic required in the window (at most window_min).

integer
recover_min

Consecutive clear minutes before an incident resolves.

integer
uptime_host_match_type

Required to be exact, wildcard or regex once either host list is non-empty; it is forced back to empty when both lists are cleared.

string
Allowed values: "" exact wildcard regex
uptime_host_includes

Send an explicit [] to clear the list — omitting the field leaves it unchanged.

Array<string>
<= 200 items
uptime_host_excludes

Send an explicit [] to clear the list.

Array<string>
<= 200 items
notify_email

Master switch for email alerts, for every recipient.

boolean
notify_sms

Master switch for SMS alerts. SMS also needs a plan with uptime_sms_enabled.

boolean
notify_webhook

Turning it on requires a saved webhook_url.

boolean
webhook_url

http:// or https://. No username/password, and no private, loopback or link-local address. Send "" to remove the webhook, which also switches notify_webhook off. The signing secret is generated when the first URL is saved and survives URL edits.

string
<= 2048 characters

Updated settings.

Media type application/json
object
enabled

Whether outage alerts are sent for this domain.

boolean
threshold_pct

Per-minute origin-error percentage that counts as down.

integer
window_min

Minutes the host must stay down before an incident opens.

integer
min_requests

Traffic floor — below this, no incident opens.

integer
min_active_min

Minimum populated one-minute buckets required in the window.

integer
recover_min

Consecutive clear minutes before an incident resolves.

integer
uptime_host_match_type

How uptime_host_includes / uptime_host_excludes are read. Empty when no host filter is set, which is the default and means every subdomain is watched.

string
Allowed values: "" exact wildcard regex
uptime_host_includes

Which subdomains the default whole-host watch covers. null or empty means all of them. Same syntax as a rule’s host scope.

Array<string> | null
uptime_host_excludes

Subdomains excluded from the whole-host watch. Excludes beat includes.

Array<string> | null
notify_email

Master switch for email alerts on this domain. It applies to the owner and to every member, on top of each member’s own preferences. Default true.

boolean
notify_sms

Master switch for SMS alerts. Default true. SMS also needs a plan with uptime_sms — on a plan without it no SMS is sent, whatever this says.

boolean
notify_webhook

Whether outage events are POSTed to the domain’s webhook. Default false.

boolean
webhook_configured

Whether a webhook URL is saved. The URL itself and the signing secret are served by GET /uptime/webhook, which needs domain.settings.

boolean
bounds

Valid range for each configurable field.

object
threshold_pct_min

Lowest accepted threshold_pct.

integer
threshold_pct_max

Highest accepted threshold_pct.

integer
window_min_min

Lowest accepted window_min.

integer
window_min_max

Highest accepted window_min.

integer
min_requests_min

Lowest accepted min_requests.

integer
recover_min_min

Lowest accepted recover_min.

integer
recover_min_max

Highest accepted recover_min.

integer
Example
{
"uptime_host_match_type": ""
}

The domain query parameter is missing, the body is malformed, a threshold is out of range, or the host scope is invalid — a match type other than exact/wildcard/regex while a host filter is set, too many entries, an over-long entry, or a regex that does not compile.

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 badMatchType
{
"error": "uptime_host_match_type must be 'exact', 'wildcard', or 'regex' when a host filter is set"
}

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"
}