Skip to content

Enable or disable an uptime monitor

PATCH
/uptime/monitors/{id}/enabled
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.

id
required
integer
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
object
enabled
required
boolean
Example generated
{
"enabled": true
}

The updated monitor.

Media type application/json

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
id
integer
domain_id
integer
name

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.

string
enabled
boolean
host_pattern

Legacy single-entry host scope, kept for parity with rules. It is folded into host_includes when the scope is compiled.

string
host_match_type

Empty when the monitor has no host scope, i.e. it watches every subdomain.

string
Allowed values: "" exact wildcard regex
host_includes

null or empty means every subdomain of this domain.

Array<string>
nullable
host_excludes

Excludes beat includes.

Array<string>
nullable
path_match_type

How the path lists are read.

string
Allowed values: wildcard regex
path_includes

Request paths this monitor watches. Defaults to ["/*"] — every path — when you send an empty list.

Array<string>
path_excludes

Paths dropped from the scope. Excludes beat includes.

Array<string>
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"host_match_type": "",
"path_match_type": "wildcard"
}

Invalid monitor id, or an invalid body.

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

Missing, malformed, revoked or expired API key — or the owning account is inactive.

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

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 notFound
{
"error": "monitor not found"
}

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