Skip to main content

Documentation

Complete guide to setting up website monitoring with PingZen. API documentation, code examples, and best practices.

An API check is a short list of HTTP requests that run in order. Each step sends one request and checks the response against assertions you write, and a step can also pull values out of its response — a token, an ID — for later steps to use. The check is UP only when every step it ran passed. One request with one assertion is an HTTP monitor job; a login followed by a call that needs the token is this one.

What It Is For

Log in first, then call the endpoint that needs the token

Step one posts credentials to /auth/login and takes the token out of the JSON body. Step two sends it as an Authorization header and asserts on the answer. That proves three things at once — the credentials still work, the token is still accepted, and the protected endpoint still answers — and no single request proves any of them.

/auth/logintokenAuthorization200

A flow that only exists end to end

Create an order, then read it back by the ID the first step returned. Add an item to a cart, then fetch the cart. Both endpoints can answer 200 all day while the pair is broken, because the thing that breaks is the handoff between them — and the handoff is exactly what a second step exercises.

POST /ordersid: 42GET /orders/42404

Answers you have to look inside

A JSON response where 200 means nothing on its own — the body carries "status": "degraded", an empty list, or a queue depth. One step can assert on a value at a JSON path, on a response header, on text in the body and on how long the answer took, all against the same response.

200"status":"degraded"

The third-party APIs your product calls

A payment provider, an SMS gateway, a maps or a search API. A read-only tour of the two or three endpoints you actually depend on, with the same key your product uses, tells you that your outage is theirs before support does.

API

What It Is Not For

This monitor is a sequence. If you do not need a sequence, something else is a better fit:

You want to knowUse instead
Does this one endpoint answer with the right status code, or contain a keyword? Nothing is carried anywhereHTTP / HTTPS monitor
Does the flow work in a browser — clicking, filling the form, anything that needs JavaScript to run? An API check speaks HTTP only and never renders a pageTransaction monitor
Is my gRPC service healthy? The steps here are plain HTTP requests, not RPC callsgRPC monitor
How fast is the API under load, how many requests per second does it hold?Not supported. PingZen runs the steps once per interval, one request at a time. A response-time assertion is a ceiling on one request, not a load test
Is my internal API alive, the one on a private address or behind a VPN? Every step URL must be http or https and resolve to a public address — private ranges are refused before the request is sentHeartbeat monitor, which your own job calls from inside
Is the port open, is the database accepting connections — something that is not HTTP at all?TCP / UDP monitor

How a Check Runs

  1. The steps run in the order they are listed, from the top. A monitor may hold up to 50 of them.
  2. Before each request, {{variable}} placeholders are replaced with what is known so far — values you defined up front, plus everything extracted by earlier steps.
  3. The step URL is checked: it must be http or https, and it must not resolve to a private, loopback or link-local address.
  4. The request is sent. Redirects are followed unless the step says otherwise.
  5. The assertions on that step are evaluated, all of them, and then the step’s variable extractions run.
  6. If the step failed and Stop on failure is on — it is by default — the remaining steps are skipped.

Two numbers end up on the check: the response time is the time of the whole run, every step together, and the HTTP status shown is the one from the last step that produced a status code.

What a Step Can Check

Assertions are what make a step pass or fail. A step with no assertions at all passes on any response it gets, including a 500 — so every step needs at least one.

AssertionWhat it looks at
Status codeThe HTTP status of the response
JSON pathThe value at a JSONPath expression, such as $.data.status. The first match is used. A path that is not there fails the assertion, unless the operator is "does not exist"
Body containsText in the raw response body, matched exactly, upper and lower case included
Body regexA regular expression searched in the body. The search covers the first 100 000 characters; a pattern that is still running after 2 seconds, or one that does not compile, fails the assertion
HeaderA response header by name — its value, or simply whether it is present
Response timeHow long that one step took, in milliseconds

The operators are: equals, not equals, contains, does not contain, matches (a regular expression), less than, less than or equal, greater than, greater than or equal, exists, does not exist. Everything is compared as text except the four size operators, which read both sides as numbers and fail the assertion if either side is not one. So a status code asserted as 200 and as "200" behave the same.

Passing Values Between Steps

This is the part a plain HTTP monitor cannot do. A step declares what to pull out of its response and under what name; later steps write {{name}} wherever the value belongs. Names are letters, digits and underscores. A name nobody defined is left in the text exactly as written, which is usually visible in the failure that follows.

Take the value fromWhat you get
JSON pathThe first match of a JSONPath expression — the usual way to lift a token or an ID
HeaderA response header by name, for example Location after a redirect
CookieA cookie from the response by name
BodyThe whole body as text, or — with a regular expression — its first capture group
Status codeThe HTTP status as text
Response timeThat step's time in milliseconds, as text

Each extraction can carry a fallback value, used when the extraction finds nothing.

A placeholder is replaced in four places: the step URL, the values of that step’s own headers, the request body, and the authentication fields (token, user name, password). It is not replaced in headers you set globally for all steps, and it is not replaced in the expected value of an assertion — you cannot assert that a response equals a variable. Put anything that has to carry a variable into the step’s own headers.

Status Logic

The check is UP only when every step that ran passed. There is no degraded state for this monitor: a rate-limited or slow API fails whichever assertion catches it, or passes.

ResultStatus
Every step ran and every assertion passedUP
An assertion failed on some stepDOWN
A request could not be made: connection refused, DNS failure, TLS error, a URL that is not http/https, a URL pointing at a private address, a header PingZen refuses to sendDOWN
The monitor has no steps configured, or more than 50DOWN
A step cannot be read at all — an unknown method, an unknown assertion type, a missing URL, a field PingZen does not recogniseDOWN
A step's own request timed out, or the whole check ran past its budgetTIMEOUT

DOWN and TIMEOUT both count as downtime and both open an incident — after the confirmation threshold, three consecutive failing checks by default, so one bad deploy minute does not page anyone.

The error message recorded on the check is the message from the failing step, with up to three failed assertions joined together — for example Status code 500 did not match equals 200. It says what failed, but not which step it was, so give each step a name you will recognise and keep the assertions on a step distinct enough to tell apart. Per-step results are not stored with the check either: one status, one total time, one message.

A step PingZen cannot read at all fails the whole check, and nothing is sent: the message names the step, as in API check misconfigured — 1 of 3 steps are misconfigured (step 2: missing required field(s): url). One unreadable step out of several is enough — a workflow that cannot run everything you configured is not allowed to report up. The form and the API also refuse such a configuration when you save it, so this only appears on monitors written before that check existed.

Configuration

Steps

Up to 50, each with a name, a method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS), a URL and its assertions. The arrows next to a step move it in the order. There is no separate address field on the monitor: it takes the URL of the first step.

Stop on failure

On by default, and usually right: once the login step fails, the steps that need its token can only fail in more confusing ways. Turn it off when the steps are independent and you would rather see all of them tried. A single step can also be marked to continue anyway, through the API.

Timeout

This is the budget for the whole check, not for one request: PingZen stops the run at the timeout plus five seconds and records a TIMEOUT. The form starts new monitors at 30 seconds, which gives every step together 35 seconds; 120 seconds is the ceiling. Each step separately gets 30 seconds unless you set another value through the API — so with a short timeout the whole-check budget is what actually stops a slow step.

Interval

60 seconds by default; your plan sets how much lower you can go. Remember that one check is several real requests against your API and against any rate limit it enforces — a five-step check every minute is 7 200 requests a day.

Authentication

Set once for all steps or per step, where the step's own setting wins. Bearer token, basic user and password, an API key in a header, or a custom header — all four build a request header, and all four accept {{variables}}, so a token extracted at step one can be the credential from step two onward.

Headers and starting variables

Headers can be set for all steps at once or on a single step, where a step's header replaces the global one of the same name. Starting variables are values you define up front — an account ID, a base URL — available to the first step already.

Because tokens and passwords live inside this configuration, it is left out of CSV export of your monitors. Import still accepts it if you fill it in yourself.

What the Form Does Not Show

The step editor in the monitor form covers steps, methods, URLs, a request body for POST, PUT and PATCH, and assertions. Everything else this page describes exists in the monitor but has no input in the form, and is set through the REST API or the MCP tools on the same monitor: request headers, variable extraction, starting variables, authentication, per-step timeouts, redirect handling, and the per-step “continue anyway” flag. Editing a monitor in the form keeps those values — the editor writes back the fields it knows and leaves the rest alone.

Two more gaps worth knowing before you build a flow in the form:

  • A body typed in the form is sent as raw text with no Content-Type header. An API that requires application/json will reject it. Add the header through the API — as a global header or on that step — or send the body as a JSON object rather than text, which sets the header itself.
  • The assertion operator list in the form is shorter than what the check supports. Less-than-or-equal, greater-than-or-equal, exists and does not exist work, but only through the API.

And two settings that exist in the configuration but do nothing today, so do not plan around them: an API key placed in the query string instead of a header is never added to the URL, and turning off certificate verification on a step has no effect — certificates are always verified.

Key Features

  • Up to 50 HTTP requests in one monitor, run in order, with the whole sequence passing or failing as one check
  • Values extracted from a response — a token, an ID, a header, a cookie — carried into later steps as {{variables}}
  • Six assertion types per step, including JSONPath into the response body, and eleven operators
  • Per-step authentication (bearer, basic, API key, custom header) that can use an extracted token
  • Stop at the first failing step, or run them all and report what broke
  • Step URLs are restricted to public http and https addresses, so a monitor cannot be pointed at internal infrastructure

Common Questions

What protocols can I monitor?

PingZen supports 23 protocols: HTTP/HTTPS, WebSocket (WS/WSS), TCP, UDP, ICMP Ping, gRPC, DNS, WHOIS, TLS/SSL certificates, Email (SMTP/IMAP/POP3), FTP/FTPS, DNSBL, PageSpeed, SOCKS5, MTProxy, API Check, and Transaction. You can monitor websites, APIs, servers, databases, and any network service.

How fast can I get alerts?

Telegram alerts are delivered within 1-2 seconds of detection. Slack and Discord notifications arrive almost instantly. You can configure multiple alert channels for redundancy.

Can I organize monitors by project?

Yes! PingZen supports workspaces, which let you organize monitors by project, environment, or team. Each workspace can have its own alert configurations and team members.

Is there an API for automation?

Absolutely. PingZen provides a full REST API with OpenAPI documentation. You can create, update, and delete monitors programmatically.

How do status pages work?

Status pages are public, branded pages showing your services' uptime. You can display real-time status and allow customers to subscribe for updates.

What happens if I reach my monitor limit?

We'll notify you when approaching your limit. You can pause some monitors or contact us for increased capacity. We never stop monitoring without warning, ensuring your critical services stay protected.

Ready to stop missing downtime?

Join thousands of teams who trust PingZen. Setup takes 30 seconds.