PUT/v1/monitors/{monitor_uuid}

Update a monitor

Updates a monitor. Only the fields you send change.

Request

Path Parameters
uuidstringrequired
The unique identifier of the monitor to update
Example:"mon_3GhAQMYGEQuyUH"
Bodyapplication/json
namestringoptional
Pronounceable name of the monitor
external_idstringoptional
Sets or changes your own identifier for the monitor; null removes it. It must not be used by another monitor of the project, otherwise the request returns 409 with the uuid of that monitor. See Create or update a monitor.
urlstringoptional
The URL of your website or host
protocolenum<string>optional
Type of monitor. A monitor can't be turned into a browser check or back: create a new monitor instead.
Available options:
httpporticmpdns
scriptstringoptional
New Playwright test of a browser check. It replaces the current script and takes effect on the next run. Browser checks only, up to 100,000 characters.
env_variablesarray<object>optional
The full list of variables the browser check should have, as objects with name and value. Variables left out are deleted, and [] deletes them all. An entry with a name but no value keeps the value already stored under that name: send back the env_variables list from Get a monitor and add a value only where it changes. Browser checks only.
dns_record_typeenum<string>optional
DNS record type (A, AAAA, CNAME, MX, NS, TXT, SOA, SRV, CAA, PTR). Only used when protocol is dns
dns_nameserverstringoptional
Nameserver to query against. Only used when protocol is dns
dns_expected_answerstringoptional
Expected DNS answer to validate against. Only used when protocol is dns
regionsarray<string>optional
Array of region names to monitor from. Browser checks run from frankfurt and sanfrancisco only.
Available options:
sanfrancisconyclondonparisfrankfurtseoulmumbaibangaloresaopaulocaliforniavirginiasydneytorontoamsterdamsingaporetokyobahraincapetown
check_frequencynumberoptional
Check frequency in seconds. A browser check takes 300, 600, 900, 1800, 3600, 21600, 43200 or 86400.
Available options:
1020306012018030060018003600216004320086400
http_methodenum<string>optional
HTTP method for the request
Available options:
GETPOSTPUTHEADDELETEPATCHOPTIONS
request_bodystringoptional
Request body for POST, PUT, PATCH requests
request_headersarray<object>optional
Array of objects with name and value for custom headers
follow_redirectsbooleanoptional
Whether to follow HTTP redirects
ip_versionenum<number>optional
IP version used to reach the target: 4 or 6. An IPv6 monitor is checked over IPv6 only, never IPv4. Available for the http, port and icmp protocols. Checks run only from the selected regions that have an IPv6 probe, and the request is rejected if none of the selected regions has one. See IP version.
Available options:
46
portnumberoptional
Port number to check. Required if protocol is port
expected_status_codestringoptional
Expected HTTP status code. Use "2xx" for 200-299, "1xx-3xx" for 100-399, or a specific code like "200".
Example:"2xx"
required_keywordstringoptional
Triggers downtime if body response is missing this keyword
pausedbooleanoptional
Whether the monitor should be paused
alerts_waitnumberoptional
Minutes to wait before sending alerts. Use -1 to disable alerts.
Available options:
-101235103060
ssl_alert_daysnumberoptional
Days before the TLS certificate expires to send the first expiry alert. -1 = never. When omitted on create, the default applies.
Available options:
-113715306090
ssl_remindersbooleanoptional
Also remind at each step below the threshold (30, 15, 7, 3 and 1 days). Default true.
ssl_notify_on_changebooleanoptional
Notify when the server starts serving a different certificate. Default false.
domain_alert_daysnumberoptional
Days before the domain registration expires to alert. -1 = never (default for monitors created through the API).
Available options:
-1714306090
group_idnumberoptional
Monitor group to move the monitor to, from the Monitor Groups API. It goes last in the group unless sort_order is set. null takes it out of its group.
sort_ordernumberoptional
Position of the monitor in its group
escalation_policystringoptional
Policy UUID to link. Send null or "none" to unlink.
Example:"policy_123abc"

Response

Returns the updated monitor object, or 409 with message and uuid when the external_id belongs to another monitor.

RequestcURL
curl -X PUT https://api.hyperping.io/v1/monitors/mon_3GhAQMYGEQuyUH \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Website",
    "url": "https://acme.com",
    "regions": ["paris", "frankfurt", "amsterdam", "london"],
    "http_method": "GET",
    "check_frequency": 30,
    "request_headers": [
      { "name": "X-Request-Header", "value": "Header value" }
    ],
    "protocol": "http"
  }'
200 OKJSON
{
  "name": "Website",
  "url": "https://acme.com",
  "paused": false,
  "regions": [
    "paris",
    "frankfurt",
    "amsterdam",
    "london"
  ],
  "http_method": "GET",
  "check_frequency": 30,
  "request_headers": [
    {
      "name": "X-Request-Header",
      "value": "Header value"
    }
  ],
  "protocol": "http",
  "port": null,
  "follow_redirects": true,
  "ip_version": 4,
  "expected_status_code": "2xx",
  "request_body": "",
  "projectUuid": "0109c1f0-b521-44f4-9681-9046aa6f51d8",
  "uuid": "mon_3GhAQMYGEQuyUH",
  "status": "up",
  "ssl_expiration": 90,
  "ssl_alert_days": 30,
  "ssl_reminders": true,
  "ssl_notify_on_change": false,
  "domain_alert_days": 30,
  "domain_expiration": 214,
  "alerts_wait": 0,
  "escalation_policy": {
    "uuid": "policy_EGy0NOiHLLYiva",
    "name": "On-Call DevOps"
  }
}
Request: browser checkcURL
# PASSWORD has no value: it keeps the one stored.
curl -X PUT https://api.hyperping.io/v1/monitors/mon_7BLzvBqgJYdvpm \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "check_frequency": 900,
    "env_variables": [
      { "name": "BASE_URL", "value": "https://help.acme.com/en" },
      { "name": "PASSWORD" }
    ]
  }'