HTTP Status Codes for Monitoring
Choose expected HTTP responses and assertions that match the endpoint you are testing.
Login2Cloud product team · Published 2026-09-27
Start with the endpoint contract
A response code is a concise protocol outcome, not a complete business-health result. A readiness endpoint may require exactly 200, a successful creation may return 201, and an intentional no-content response may use 204. Set expectations for the specific endpoint rather than accepting every response below 500.
Treat redirects intentionally
A 301 or 302 can be normal for a website moving visitors to its canonical URL. It can also hide an expired login session when an API unexpectedly redirects to an authentication page. Login2Cloud website checks can follow bounded, revalidated redirects; API monitors do not follow them, so request credentials remain at the configured endpoint.
Interpret client and server errors
A 401 generally points to missing or invalid authentication; 403 indicates refusal; 404 means the requested resource was not found. A 429 commonly indicates a rate limit. Server-side 5xx responses indicate a failure to fulfill the request, but the exact root cause still needs application and infrastructure evidence. Do not increase monitor frequency when an endpoint is already rate limiting checks.
Assert the useful payload
A 200 response containing an error object should not pass merely because its status is successful. Add a typed JSON assertion such as ready equal to true, a required text marker, or an exact response-header expectation. Use stable fields and keep assertions independent from personal or time-varying content.
Keep requests bounded and safe
Use a dedicated endpoint and credentials with the minimum permissions needed. POST, PUT, PATCH and DELETE can change application data: choose endpoints designed for repeatable monitoring. Set a sensible timeout and response-time limit. Login2Cloud limits request/response sizes and does not retain full response bodies.
Common questions
Should every 2xx response count as healthy?
Only if that matches the endpoint contract. An exact status and payload assertion often provide a stronger signal.
Does a timeout have an HTTP status?
A timeout can occur before any complete HTTP response exists, so there may be no status code.