Documentation

Error Handling

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

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:

json
{
"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

json
HTTP 401
{
"error": "token has expired"
}

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

Invalid Request Body

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

Resource Not Found

json
HTTP 404
{
"error": "resource not found"
}

Rate Limited

json
HTTP 429
{
"error": "rate limit exceeded"
}