API Error Codes

Complete reference of SmallPict API error codes and their meanings.

Error Code Reference

All SmallPict API errors follow a consistent JSON format:

{
  "code": "error_code",
  "message": "Human-readable description"
}

Authentication Errors

HTTP StatusCodeDescriptionPlugin UI State
401invalid_otpThe OTP code is incorrectOTP input shakes, red border
401expired_otpThe OTP has expired (15 min TTL)Reverts to email input screen
401invalid_api_keyAPI key is revoked or doesn't existShows "Disconnected" notice
403access_deniedEmail not in staff allowlistLogin page shows "Access Denied"

Rate Limiting

HTTP StatusCodeDescriptionPlugin UI State
429rate_limitedToo many OTP requests (max 5/24h)"Send Code" button disabled
429quota_exceededMonthly usage quota reachedProcessing paused, upgrade CTA

Processing Errors

HTTP StatusCodeDescription
400validation_errorMalformed request body
413file_too_largeImage exceeds max file size for plan
415unsupported_formatFile type not supported
500internal_errorUnexpected server error
503service_unavailableLambda cold start or temporary outage

Handling Errors in WordPress

The SmallPict plugin handles these errors automatically. When an error occurs during image processing:

  1. The original image is preserved (never deleted)
  2. A WordPress admin notice appears with the error message
  3. The image can be retried manually from the Media Library