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
| Status | Meaning |
|---|---|
200 | Success |
201 | Created |
204 | No Content (DELETE success) |
400 | Bad Request — invalid request body or parameters |
401 | Unauthorized — missing or invalid API key |
403 | Forbidden — API key lacks required scope |
404 | Not Found — resource doesn't exist or doesn't belong to you |
409 | Conflict — duplicate resource (e.g., monitor URL already exists) |
422 | Unprocessable Entity — validation error |
429 | Too Many Requests — rate limit exceeded |
500 | Internal Server Error — contact support |
503 | Service Unavailable — planned maintenance |
Error codes
Authentication
| Code | Description |
|---|---|
api_key_missing | No Authorization header provided |
api_key_invalid | API key format is incorrect |
api_key_expired | API key has passed its expiry date |
api_key_revoked | API key was revoked by account owner |
insufficient_scope | API key lacks the required permission scope |
Resources
| Code | Description |
|---|---|
resource_not_found | The requested resource doesn't exist |
resource_already_exists | Duplicate resource (e.g., same monitor URL) |
resource_limit_reached | Plan limit reached (e.g., max monitors) |
Validation
| Code | Description |
|---|---|
validation_error | One or more fields failed validation — see details |
invalid_url | URL format is invalid or not reachable |
invalid_location | Unknown check location code |
invalid_interval | Interval not in allowed values |
Rate Limiting
| Code | Description |
|---|---|
rate_limit_exceeded | Request 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()