Skip to content
smallPict
Start free

Standard Error Codes & Envelopes

Error response format, error codes, and HTTP status codes of the smallPict API.

Every error response uses the same JSON structure with a machine-readable error code.


Error response format

JSON
{  "error": {    "code": "QUOTA_EXCEEDED",    "message": "Monthly image processing quota limit reached for your plan.",    "details": {      "bytes_used": 5368709120,      "requested_bytes": 2450000,      "bytes_limit": 5368709120,      "plan": "wp_pro",      "upgrade_url": "https://smallpict.app/dashboard/billing",      "reset_at": "2026-12-01T00:00:00Z"    }  }}

Error codes

HTTP StatusErrorCode EnumException TypeDescription
400VALIDATION_FAILEDValidationErrorThe request failed validation: a required field is missing, or a value or file type is not accepted.
400file_too_largeValidationErrorThe image is larger than your plan's per-file limit. details has limit_mb, file_mb, plan and upgrade_url.
401UNAUTHORIZEDAuthenticationErrorMissing or invalid API key or HMAC-SHA256 signature, or a timestamp more than 300 seconds away from the server's clock ("timestamp drift too large").
402QUOTA_EXCEEDEDQuotaExceededErrorMonthly account processing quota exhausted.
402OVERAGE_EXCEEDEDQuotaExceededErrorPlan overage buffer limit exceeded.
403FORBIDDENPermissionDeniedErrorThe API key is revoked, or the account is scheduled for deletion.
403feature_restrictedPermissionDeniedErrorThe requested output is not in your plan, such as avif (alone or in target_formats) on WordPress Free or Starter.
403KEY_SCOPE_MISMATCHPermissionDeniedErrorUsing a WordPress scoped key (sp_wp_...) on an SDK endpoint or vice versa.
404NOT_FOUNDNotFoundErrorThe requested resource or conversion job_id does not exist.
429RATE_LIMIT_EXCEEDEDRateLimitErrorToo many requests in a short duration. Follow the Retry-After header.
500INTERNAL_ERRORServerErrorAn unhandled error occurred on the server. Details are logged securely.

QUOTA_EXCEEDED and OVERAGE_EXCEEDED carry details.reset_at (RFC 3339), the moment the quota resets, and details.in_flight_bytes when images still being processed were counted. Older API versions answered file_too_large and feature_restricted with HTTP 500; read error.code from the body rather than relying on the status alone.


Error handling in the SDKs

The SDKs turn these errors into typed exceptions for each language and retry 429 and 5xx responses with exponential backoff and jitter.


Capacity, mode and folder errors

Codes for storage, the unpaid-account cycle, compression modes and folders. Capacity errors carry details.upgrade_url, a link to the dashboard page where you add what is missing; show it, never follow it automatically.

StatusCodeSDK errorMeaning
400invalid_modeValidationErrorUnknown mode.
400invalid_folderValidationErrorThe folder value is malformed.
402storage_quota_exceededQuotaExceededErrorStorage is full: new files are refused, stored files keep being served.
402account_read_onlyQuotaExceededErrorThe subscription stopped being paid: files are read-only until it is paid (details.delete_after).
403mode_not_in_planPermissionDeniedErrorThe mode is not in your plan (details.allowed_modes).
429purge_rate_limitedRateLimitErrorToo many folder or all-files purges in the last hour. Not retried automatically.