Skip to main content

Error Codes

All API errors return a consistent JSON structure with an error code and human-readable message.

Error Response Format

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error description."
}
}

Error Code Reference

Client Errors (4xx)

CodeHTTP StatusDescription
VALIDATION_ERROR400Invalid input data (malformed JSON, invalid UUID, etc.)
FILE_REQUIRED400Upload endpoint called without a file
INVALID_FILE_TYPE400File MIME type not in allowed list (must be image/jpeg, image/png, or application/pdf)
INVALID_FORMAT400Export format must be docx or xlsx
NOT_READY400Document must be completed with OCR results before this operation
NO_FILE400No file stored for this document
QUERY_REQUIRED400Search endpoint called without q parameter
INVALID_TOKEN400Verification, reset, or confirmation token is invalid, expired, or already used
UNAUTHORIZED401Missing, invalid, or expired access token
INVALID_CREDENTIALS401Wrong email or password during login
ACCOUNT_DISABLED403User account has been deactivated
EMAIL_NOT_VERIFIED403Email address not yet verified (must verify before accessing the API)
DEVICE_NOT_CONFIRMED403New device requires email confirmation before login can proceed
DOCUMENT_NOT_FOUND404Document doesn't exist or belongs to a different user
EMAIL_TAKEN409Email address already registered
RATE_LIMITED429Too many requests; includes Retry-After header

HTTP Status Codes

StatusMeaning
200Success
201Created (registration)
202Accepted (async email queued)
204No Content (successful delete)
400Bad Request (validation error)
401Unauthorized (auth failure)
403Forbidden (not verified, not confirmed, or disabled)
404Not Found
409Conflict (duplicate)
429Rate Limited
500Internal Server Error

Rate Limiting

When you receive a 429 response, check the Retry-After header for the number of seconds to wait before retrying:

HTTP/1.1 429 Too Many Requests
Retry-After: 15
Content-Type: application/json

{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests. Please wait 15 seconds."
}
}

Rate Limits by Endpoint

EndpointLimit
POST /v1/auth/register5 per hour per IP
POST /v1/auth/login3 free, then exponential backoff (15s, 30s, 60s, 300s)
POST /v1/auth/resend-verification1 per minute, 5 per hour per email
POST /v1/auth/forgot-password1 per minute, 5 per hour per email

Handling Errors

Best Practices

  1. Always check the HTTP status code before parsing the response body
  2. Parse the error.code field for programmatic error handling
  3. Display error.message to users for human-readable feedback
  4. Implement token refresh -- when you receive a 401, try refreshing the access token before re-authenticating
  5. Respect rate limits -- implement exponential backoff when receiving 429 responses