Skip to main content Skip to content

Error Handling

ZopNight uses standard HTTP status codes and returns structured JSON error responses. Reference for status codes, retry strategy, and common error scenarios.

2 min read Last updated: 

ZopNight uses standard HTTP status codes and returns structured error responses.

Error Response Format

When an error occurs, the API returns a JSON response with a string error field:

Terminal window
{
"error": "schedule not found"
}

HTTP Status Codes

CodeMeaningCommon Causes
200OKRequest succeeded
201CreatedResource created successfully
400Bad RequestInvalid request body, missing required fields, validation errors
401UnauthorizedMissing, invalid, or expired JWT token
403ForbiddenInsufficient permissions or accessing another organization's resources
404Not FoundResource, schedule, or endpoint does not exist
409ConflictDuplicate resource, schedule name already exists
429Too Many RequestsRate limit exceeded — see Rate Limiting
500Internal Server ErrorUnexpected server error — retry with backoff
502Bad GatewayGateway could not reach the backend service
503Service UnavailableService is temporarily unavailable

Retry Strategy

StatusAction
4xx (except 429)Do not retry. Fix the request and try again.
429Back off and retry after the period indicated in the response.
500Retry with exponential backoff (1s, 2s, 4s, 8s).
502/503Retry with exponential backoff. The service may be restarting.

Common Error Scenarios

Expired Token

Terminal window
HTTP 401
{
"error": "token has expired"
}

Use the /auth/refresh endpoint to get a new access token.

Invalid Request Body

Terminal window
HTTP 400
{
"error": "invalid cron expression: '0 25 * * *'"
}

Resource Not Found

Terminal window
HTTP 404
{
"error": "resource not found"
}

Rate Limited

Terminal window
HTTP 429
{
"error": "rate limit exceeded"
}
Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001 · zero-trust· 30% average cloud cost cut· 4 platforms · 1 console· Multi-cloud automation· Production-ready in 30 min· SOC 2 · ISO 27001 · zero-trust· 30% average cloud cost cut· 4 platforms · 1 console·