Errors & limits
HTTP status codes
| Code | Meaning | Common cause |
|---|---|---|
| 200 | OK | Sync extraction completed |
| 202 | Accepted | Async job queued |
| 401 | Unauthorized | Missing or invalid API key |
| 402 | Payment Required | Zero credit balance |
| 422 | Unprocessable | Validation error (file type, size, params) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Server Error | Pipeline or infrastructure failure |
| 503 | Service Unavailable | OCR/LLM provider down or disabled |
Error response format
{
"error": "error_code",
"message": "Human-readable description",
"details": {}
}
Common error codes
| error | Description |
|---|---|
invalid_api_key | Bearer token missing or not recognised |
insufficient_credits | Balance is 0 |
validation_failed | Invalid file, document_type, or options |
file_too_large | Exceeds 50 MB |
unsupported_media_type | Not a PDF |
extraction_failed | Pipeline could not process document |
rate_limit_exceeded | Too many requests per minute |
Limits
| Limit | Value |
|---|---|
| Max file size | 50 MB |
| Rate limit | 60 req/min per API key |
| Default confidence threshold | 0.7 |
| Cache TTL | 30 days |
Health check
GET https://cyber.lerepop.lv/api/v1/health
Checks database, Redis, and Poppler availability. No authentication required.
Validation tips
- Always send
Authorization: Bearer— not raw key without prefix - File field must be named
filein multipart form document_typemust be one of the supported enum valueswebhook_urlmust be HTTPS in production