Skip to content

Update outage-detection settings

PUT
/uptime/settings
curl --request PUT \
--url 'https://api.nsin.cloud/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 }'

Partial update — omitted fields keep their current value.

Out-of-range values are rejected, not clamped. A threshold_pct outside 50–100, a window_min outside bounds.window_min_minwindow_min_max, a min_requests below 1, a min_active_min outside 1–window_min, or a recover_min outside 1–30 fails the whole request with 400, naming the offending field, and nothing is written. The one value the server adjusts silently is min_active_min: if the update lowers window_min below it, it is pulled down to match, because it can never exceed the window.

Requires analytics.view, not domain.settings. The handler resolves the domain with the same permission the uptime reads use, and every role has analytics.view — so a viewer, who can change nothing else on the domain, can switch outage alerts off or move the thresholds far enough that no incident ever opens. Treat viewer on a domain as “can silence outage alerting” and grant it accordingly.

A disabled domain does not block this write either. The disabled-domain guard only covers configuration permissions and analytics.view is not one of them, so there is no 409 here.

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
boolean
threshold_pct
integer
window_min
integer
min_requests
integer
min_active_min
integer
recover_min
integer
Example generated
{
"enabled": true,
"threshold_pct": 1,
"window_min": 1,
"min_requests": 1,
"min_active_min": 1,
"recover_min": 1
}

The settings as stored, with the valid range for each in bounds.

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
bounds

Valid range for each configurable field.

object
threshold_pct_min
integer
threshold_pct_max
integer
window_min_min
integer
window_min_max
integer
min_requests_min
integer
recover_min_min
integer
recover_min_max
integer
Example generated
{
"enabled": true,
"threshold_pct": 1,
"window_min": 1,
"min_requests": 1,
"min_active_min": 1,
"recover_min": 1,
"bounds": {
"threshold_pct_min": 1,
"threshold_pct_max": 1,
"window_min_min": 1,
"window_min_max": 1,
"min_requests_min": 1,
"recover_min_min": 1,
"recover_min_max": 1
}
}

The domain query parameter is missing, the body is malformed, or a value is outside its bound — for example threshold_pct must be between 50 and 100. Nothing is saved.

Media type application/json

The error shape used by every endpoint. error is always present. code is present only on the failures that have one — do not require it, and do not parse error to recover it.

object
error
required

Human-readable description of what went wrong.

string
code

Stable machine-readable reason. Present on some failures only; the wording of error may change, this will not.

  • account_suspended403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.
  • domain_disabled409, not 403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.
  • managed_by_reseller403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.
  • invite_email_mismatch403 from POST /invites/{token}/accept. The invitation was addressed to a different email; the body also carries invited_email, masked.

A panel session — not an API key — can additionally see session_check_failed on a 503, which means the session could not be verified, not that it is invalid. Retry it; do not discard the token.

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

Missing, malformed, revoked or expired API key, or a key whose owning user row is gone. A key whose owning account has merely been deactivated is not this: that is 403 with code: account_suspended, because the credential itself is intact and re-issuing it changes nothing.

Media type application/json

The error shape used by every endpoint. error is always present. code is present only on the failures that have one — do not require it, and do not parse error to recover it.

object
error
required

Human-readable description of what went wrong.

string
code

Stable machine-readable reason. Present on some failures only; the wording of error may change, this will not.

  • account_suspended403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.
  • domain_disabled409, not 403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.
  • managed_by_reseller403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.
  • invite_email_mismatch403 from POST /invites/{token}/accept. The invitation was addressed to a different email; the body also carries invited_email, masked.

A panel session — not an API key — can additionally see session_check_failed on a 503, which means the session could not be verified, not that it is invalid. Retry it; do not discard the token.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The key is read-only and this endpoint is a write. Read-only keys may only issue GET, HEAD and OPTIONS.

Media type application/json

The error shape used by every endpoint. error is always present. code is present only on the failures that have one — do not require it, and do not parse error to recover it.

object
error
required

Human-readable description of what went wrong.

string
code

Stable machine-readable reason. Present on some failures only; the wording of error may change, this will not.

  • account_suspended403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.
  • domain_disabled409, not 403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.
  • managed_by_reseller403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.
  • invite_email_mismatch403 from POST /invites/{token}/accept. The invitation was addressed to a different email; the body also carries invited_email, masked.

A panel session — not an API key — can additionally see session_check_failed on a 503, which means the session could not be verified, not that it is invalid. Retry it; do not discard the token.

string
Examples
Example readOnly
{
"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 error shape used by every endpoint. error is always present. code is present only on the failures that have one — do not require it, and do not parse error to recover it.

object
error
required

Human-readable description of what went wrong.

string
code

Stable machine-readable reason. Present on some failures only; the wording of error may change, this will not.

  • account_suspended403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.
  • domain_disabled409, not 403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.
  • managed_by_reseller403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.
  • invite_email_mismatch403 from POST /invites/{token}/accept. The invitation was addressed to a different email; the body also carries invited_email, masked.

A panel session — not an API key — can additionally see session_check_failed on a 503, which means the session could not be verified, not that it is invalid. Retry it; do not discard the token.

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

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

Media type application/json

The error shape used by every endpoint. error is always present. code is present only on the failures that have one — do not require it, and do not parse error to recover it.

object
error
required

Human-readable description of what went wrong.

string
code

Stable machine-readable reason. Present on some failures only; the wording of error may change, this will not.

  • account_suspended403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.
  • domain_disabled409, not 403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.
  • managed_by_reseller403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.
  • invite_email_mismatch403 from POST /invites/{token}/accept. The invitation was addressed to a different email; the body also carries invited_email, masked.

A panel session — not an API key — can additionally see session_check_failed on a 503, which means the session could not be verified, not that it is invalid. Retry it; do not discard the token.

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