Skip to content

HTTP monitors (advanced)

The “light” http type in active monitors performs only GET <url> and compares the status code with 2xx (or expectedStatus). That’s enough for a simple health-check, but doesn’t cover cases like “send POST /api/login with a JSON body and an Authorization header, then check that the response contains "status":"ok" and code 200”.

An HTTP monitor is a separate entity with its own REST API that supports:

  • arbitrary methodGET, POST, PUT, PATCH, DELETE, HEAD;
  • arbitrary headers (headers) — a JSON object {"Header": "Value"};
  • request body (body) — for POST/PUT/PATCH;
  • response filtering — by status code, range of codes, substring/regex in body, value by JSONPath, and maximum response time;
  • two reaction modes — alert on a filter “match” or “mismatch”.

Everything else (interval, timeout, consecutive failures, alert/recovery texts, pauses) works the same as for regular monitors.

FieldTypeRequiredDescription
appidnumberyesID of the channel to send notifications to
namestringyesMonitor name, 1–200 characters
methodstringyesGET, POST, PUT, PATCH, DELETE, HEAD (case-insensitive)
urlstringyesA valid http(s) URL
headersstringnoJSON object of headers: {"Authorization": "Bearer ..."}
bodystringnoRequest body (for POST/PUT/PATCH)
intervalSecnumberyesInterval between checks, 30–86400 seconds
timeoutSecnumbernoTimeout for one attempt, default 10, maximum 30
filterModestringyesalert_on_match or alert_on_mismatch (see below)
filtersstringyesJSON array of filters (see Response filters)
consecutiveFailsnumbernoHow many consecutive failures before alert, default 1, maximum 20
alertMessagestringyesNotification text when triggered, 1–2000 characters
alertTitlestringnoNotification title
alertPrioritynumbernoPush priority, 0–10
recoveryTitlestringnoRecovery message title
recoveryMessagestringnoText when returning to normal (if empty — no recovery is sent)

filters is a JSON array of objects. Each object describes a condition that the response must satisfy. You can combine multiple checks in a single filter. Available filter fields:

Filter fieldTypeWhat it checks
statusCodenumberExact HTTP code (0 = don’t check)
statusCodeMin / statusCodeMaxnumberRange of codes [min, max] inclusive (0,0 = don’t check)
bodyContainsstringSubstring that must be contained in the body
bodyRegexstringRegular expression (Go syntax) for the body
jsonPathstringPath in a JSON response, e.g. $.status or data.0.id
jsonPathValuestringExpected value at jsonPath (string comparison)
maxDurationMsnumberMaximum allowed response time in ms (0 = don’t check)
  • alert_on_mismatch — describe what a normal response looks like. If the actual response does not match the filters — an alert is sent. This is a whitelist logic and the most common scenario.
  • alert_on_match — describe a problematic response. If the actual response matches the filter — an alert is sent. Useful to catch specific errors.
// filterMode = "alert_on_mismatch":
// normal — code 200 and JSON {"status":"ok"}; otherwise alert.
[
{ "statusCode": 200, "jsonPath": "$.status", "jsonPathValue": "ok" }
]
// filterMode = "alert_on_match":
// alert if the word "maintenance" appears in the body OR the code is in 5xx.
[
{ "bodyContains": "maintenance" },
{ "statusCodeMin": 500, "statusCodeMax": 599 }
]
// normal — responds faster than 800 ms and code 2xx (filterMode = "alert_on_mismatch"):
[
{ "statusCodeMin": 200, "statusCodeMax": 299, "maxDurationMs": 800 }
]

An HTTP monitor uses the same statuses as regular monitors: pending (created, no checks yet), up, degraded (there are failures, but the consecutiveFails threshold has not yet been reached), down (alert sent), and paused.

EventWhenText
AlertAfter consecutiveFails consecutive filter triggers (according to filterMode), only on the first transition to down. Technical information is added to the message (last code, body preview, error)alertMessage
RecoveryOn the first successful check after down, only if recoveryMessage is setrecoveryMessage

While the monitor is down, no repeated alerts will be sent — checks continue and only record the status.

Before creating a monitor you can perform a one-time test request and inspect the response — nothing is saved. POST /http-monitor/test accepts method, url, headers, body, timeoutSec and returns statusCode, bodyPreview (first 2048 characters), headers (JSON of response headers), durationMs and error (if the request failed).

Окно терминала
curl -X POST "$NOTIFLY_URL/http-monitor/test" \
-H "Content-Type: application/json" \
-H "X-Notifly-Key: <client-token>" \
-d '{
"method": "POST",
"url": "https://api.example.com/login",
"headers": "{\"Content-Type\": \"application/json\"}",
"body": "{\"user\":\"probe\",\"pass\":\"...\"}",
"timeoutSec": 10
}'
# → {"statusCode":200,"bodyPreview":"{\"status\":\"ok\"}","headers":"{...}","durationMs":134}
  1. Open app.notifly.ruMonitorsHTTP.
  2. Specify the name, channel, method, URL, and optionally — headers and body.
  3. Configure the interval, timeout, and number of consecutive failures.
  4. Describe the response filters and choose the mode (alert_on_match / alert_on_mismatch).
  5. Set the alert and recovery texts.
Окно терминала
curl -X POST "$NOTIFLY_URL/http-monitor" \
-H "Content-Type: application/json" \
-H "X-Notifly-Key: <client-token>" \
-d '{
"appid": 12345,
"name": "API login health",
"method": "POST",
"url": "https://api.example.com/login",
"headers": "{\"Content-Type\": \"application/json\"}",
"body": "{\"user\":\"probe\",\"pass\":\"...\"}",
"intervalSec": 60,
"timeoutSec": 10,
"filterMode": "alert_on_mismatch",
"filters": "[{\"statusCode\":200,\"jsonPath\":\"$.status\",\"jsonPathValue\":\"ok\"}]",
"consecutiveFails": 2,
"alertMessage": "Логин-эндпоинт не отвечает как надо!",
"alertPriority": 9,
"recoveryMessage": "Логин снова работает."
}'

The fields headers, body and filters are passed as strings (JSON inside JSON), so in the curl examples their contents are escaped.

If a Notifly MCP server is configured (see MCP), it’s enough to describe the task in words:

Create an HTTP monitor: POST to https://api.example.com/login with a JSON body, check every minute that the code is 200 and the response has status=ok, alert after 2 consecutive failures.

MethodPathDescription
GET/http-monitorList user’s HTTP monitors
POST/http-monitorCreate
POST/http-monitor/testOne-time test request (without saving)
PUT/http-monitor/:idUpdate settings (cannot change appid)
DELETE/http-monitor/:idDelete
POST/http-monitor/:id/pausePause checks
POST/http-monitor/:id/resumeResume

Create, update, delete, pause and resume require a client (or MCP) token with write permissions. POST /http-monitor/test is available without being tied to a specific monitor.