Enable or disable an uptime monitor
const url = 'https://api.nsin.ir/uptime/monitors/1/enabled?domain=example.com';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url 'https://api.nsin.ir/uptime/monitors/1/enabled?domain=example.com' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true }'The cheap toggle behind a monitor list’s switch — it changes nothing
else. Requires domain.settings. Disabling closes the monitor’s open
incident silently, with no recovery notification.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path 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 ”object
Example generated
{ "enabled": true}Responses
Section titled “ Responses ”The updated monitor.
A path-scoped uptime watch. It runs the SAME detector as the whole-host watch — same thresholds, same window, same incident machinery — narrowed to the host and path scope declared here. Thresholds are inherited from the domain’s uptime settings and cannot be overridden per monitor.
object
Optional label, up to 64 characters. It is what the outage SMS and the incident list call this watch, so a domain with two monitors on one host sends two distinguishable alerts.
Legacy single-entry host scope, kept for parity with rules. It is
folded into host_includes when the scope is compiled.
Empty when the monitor has no host scope, i.e. it watches every subdomain.
null or empty means every subdomain of this domain.
Excludes beat includes.
How the path lists are read.
Request paths this monitor watches. Defaults to ["/*"] — every
path — when you send an empty list.
Paths dropped from the scope. Excludes beat includes.
Example
{ "host_match_type": "", "path_match_type": "wildcard"}Invalid monitor id, or an invalid body.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}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 monitor on this domain. A monitor id belonging to another domain is reported the same way, so an id can never be used to probe another tenant.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "monitor not found"}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"}