Skip to content

Error Reference

All Picora API errors return a consistent JSON structure with a machine-readable error code.

Error Response Format

{
"success": false,
"error": "Human-readable error description"
}

The HTTP status code indicates the error category, and the error field provides details.

HTTP Status Codes

StatusMeaning
400Bad Request — Malformed request syntax
401Unauthorized — Missing or invalid authentication
403Forbidden — Authenticated but not permitted
404Not Found — Resource does not exist
422Unprocessable Entity — Validation failed
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our side

Error Code Reference

Authentication Errors

CodeStatusDescriptionHow to Fix
UNAUTHORIZED401Missing Authorization header, invalid API key format, or expired JWT token.Include a valid Authorization: Bearer sk_live_YOUR_KEY header.
API_KEY_REVOKED401The API key has been manually revoked.Create a new API key in the dashboard.
TOKEN_EXPIRED401JWT access token has expired (15-minute lifetime).Refresh the token via POST /v1/auth/refresh.

Permission Errors

CodeStatusDescriptionHow to Fix
FORBIDDEN403You do not have permission to access this resource (e.g., trying to delete another user’s image).Only access resources that belong to your account.
QUOTA_EXCEEDED403You have reached your plan’s storage or bandwidth limit.Delete unused images or upgrade your plan.
PLAN_REQUIRED403This feature requires a paid plan (e.g., video hosting requires Pro).Upgrade your plan to access this feature.

Resource Errors

CodeStatusDescriptionHow to Fix
NOT_FOUND404The requested image, video, or resource does not exist.Verify the ID is correct. The resource may have been deleted.
CONFLICT409Conflicting state (e.g., email already registered, custom domain already taken).Use a different value or resolve the conflict.

Validation Errors

CodeStatusDescriptionHow to Fix
VALIDATION_ERROR422Request body or parameters failed validation. The error field describes which field failed.Fix the indicated field and retry.
INVALID_FILE_TYPE422Uploaded file is not a supported image format.Use JPEG, PNG, GIF, WebP, AVIF, or SVG.
FILE_TOO_LARGE422File exceeds the maximum allowed size for your plan.Compress the image or upgrade your plan.

Rate Limit Errors

CodeStatusDescriptionHow to Fix
RATE_LIMITED429Too many requests in a short period.Wait and retry. The Retry-After response header indicates when to retry (in seconds).

Server Errors

CodeStatusDescriptionHow to Fix
INTERNAL500An unexpected server error occurred.Retry after a short delay. If the problem persists, contact support@picora.com with the request details.
STORAGE_ERROR500Failed to write to object storage.Retry the request. If persistent, contact support.

Handling Errors in Code

const response = await fetch('https://api.picora.com/v1/images', {
method: 'POST',
headers: { 'Authorization': 'Bearer sk_live_YOUR_KEY' },
body: formData,
});
if (!response.ok) {
const error = await response.json();
console.error(`Upload failed: ${error.error}`);
// error.error contains the human-readable description
}
const { data } = await response.json();
console.log('Uploaded:', data.url);