Update outage-detection settings
const url = 'https://api.nsin.ir/uptime/settings?domain=example.com';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"threshold_pct":1,"window_min":1,"min_requests":1,"min_active_min":1,"recover_min":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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 }'Partial update — omitted fields keep their current value. Values are
clamped to the ranges reported in bounds. 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.comRequest Body required
Section titled “Request Body required ”Every field is optional; omitted fields keep their current value.
object
Example generated
{ "enabled": true, "threshold_pct": 1, "window_min": 1, "min_requests": 1, "min_active_min": 1, "recover_min": 1}Responses
Section titled “ Responses ”Updated settings.
object
Whether outage alerts are sent for this domain.
Per-minute origin-error percentage that counts as down.
Minutes the host must stay down before an incident opens.
Traffic floor — below this, no incident opens.
Minimum populated one-minute buckets required in the window.
Consecutive clear minutes before an incident resolves.
Valid range for each configurable field.
object
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 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 — or the owning account is inactive.
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"}