14-day PRO trial · No credit card — Start free →
API Reference
Error Reference

Error Reference

Errors return a non-2xx HTTP status and a JSON body:

{ "success": false, "message": "Monitor not found" }

Validation errors (400) describe the field that failed, e.g. Minimum interval is 60 seconds.

HTTP status codes

StatusMeaning
200Success
400Bad request — invalid body or parameters (the message names the field)
401Unauthorized — missing, invalid, revoked or expired API key
403Forbidden — your plan or role does not allow this action
404Not found — the resource doesn't exist or doesn't belong to your team
429Too many requests — rate limit exceeded
500Internal server error — contact support

Handling errors in code

const res = await fetch('https://api.securecheap.com/api/v1/monitors', {
  headers: { 'X-API-Key': process.env.SECURECHEAP_API_KEY },
})
 
if (!res.ok) {
  const { message } = await res.json()
  console.error(`[${res.status}] ${message}`)
  if (res.status === 429) {
    const wait = Number(res.headers.get('RateLimit-Reset') || 60)
    await new Promise(r => setTimeout(r, wait * 1000))
  }
  return
}
 
const { monitors } = await res.json()