Zaptickdocs
Get started

Errors

Predictable error classes and HTTP codes so you can build bulletproof retry logic.

#Error shape

Every 4xx / 5xx response follows the same JSON envelope:

JSON
{
  "error": {
    "code": "validation_error",
    "message": "phone must be a valid E.164 number",
    "param": "phone",
    "requestId": "req_01J3xkx7..."
  }
}

#Status codes

StatusCodeWhenSDK class
400validation_errorMissing or invalid body params.ZaptickValidationError
401invalid_api_keyAPI key missing, malformed, or revoked.ZaptickAuthError
403permission_deniedKey lacks access to that resource.ZaptickForbiddenError
404not_foundResource does not exist or was deleted.ZaptickNotFoundError
429rate_limitedToo many requests — honor `Retry-After`.ZaptickRateLimitError
500internal_errorSomething broke on our side — retry.ZaptickError
502upstream_errorMeta / upstream failure. Safe to retry.ZaptickError

#Retry strategy

The SDK retries idempotent requests (GET, PUT, DELETE) on 429, 5xx and network errors automatically, with exponential backoff honoring Retry-After. For writes you get full control:

TypeScript
const zaptick = new Zaptick({
  apiKey: process.env.ZAPTICK_API_KEY!,
  maxRetries: 3,          // default: 2
  timeoutMs: 30_000,      // per-attempt timeout
});