🚀 SecureCheap is live — Start free →
API Reference
Error Reference

Error Reference

All errors follow this format:

{
  "error": {
    "code": "resource_not_found",
    "message": "Monitor mon_01INVALID not found",
    "request_id": "req_01HXZ3M..."
  }
}

HTTP status codes

StatusMeaning
200Success
201Created
204No Content (DELETE success)
400Bad Request — invalid request body or parameters
401Unauthorized — missing or invalid API key
403Forbidden — API key lacks required scope
404Not Found — resource doesn't exist or doesn't belong to you
409Conflict — duplicate resource (e.g., monitor URL already exists)
422Unprocessable Entity — validation error
429Too Many Requests — rate limit exceeded
500Internal Server Error — contact support
503Service Unavailable — planned maintenance

Error codes

Authentication

CodeDescription
api_key_missingNo Authorization header provided
api_key_invalidAPI key format is incorrect
api_key_expiredAPI key has passed its expiry date
api_key_revokedAPI key was revoked by account owner
insufficient_scopeAPI key lacks the required permission scope

Resources

CodeDescription
resource_not_foundThe requested resource doesn't exist
resource_already_existsDuplicate resource (e.g., same monitor URL)
resource_limit_reachedPlan limit reached (e.g., max monitors)

Validation

CodeDescription
validation_errorOne or more fields failed validation — see details
invalid_urlURL format is invalid or not reachable
invalid_locationUnknown check location code
invalid_intervalInterval not in allowed values

Rate Limiting

CodeDescription
rate_limit_exceededRequest rate exceeded for your plan

The request_id field in every error response can be shared with support to help us diagnose issues on our end.

Handling errors in code


const res = await fetch('https://api.securecheap.com/v1/monitors', {
  headers: { 'Authorization': 'Bearer sc_live_xxxx' }
})
 
if (!res.ok) {
  const { error } = await res.json()
  console.error(`[${res.status}] ${error.code}: ${error.message}`)
  // Handle specific error codes:
  if (error.code === 'rate_limit_exceeded') {
    // Wait and retry
    await new Promise(r => setTimeout(r, error.retry_after * 1000))
  }
  return
}
 
const { data } = await res.json()