Errors
How FastPic returns errors and what to expect from each status.
All FastPic API endpoints use standard HTTP status codes. Successful requests return 2xx. Failed requests return 4xx or 5xx with a JSON body containing statusCode, message, and errorStatusCode (a machine-readable enum your code can switch on).
Error response format
Every error response follows the same envelope:
error response
{ "statusCode": 401, "message": "Invalid API key", "errorStatusCode": "unauthorized"}Error codes
FastPic uses these errorStatusCode values across the API:
| Code | Status | Description |
|---|---|---|
| unauthorized | 401 | Missing or invalid API key. |
| rate_limit_exceeded | 429 | Per-key rate limit hit. |
| storage_quota_exceeded | 402 | Plan storage quota would be exceeded. |
| validation_error | 422 | Request body or query parameter invalid. |
| invalid_image_content | 422 | File is not a valid image. |
| unsupported_media_type | 415 | File format not in JPEG/PNG/WebP/AVIF. |
| file_too_large | 413 | File exceeds 10 MB. |
| not_found_error | 404 | Resource not found or not owned by this key. |