Ex Extract API

Errors & limits

HTTP status codes

CodeMeaningCommon cause
200OKSync extraction completed
202AcceptedAsync job queued
401UnauthorizedMissing or invalid API key
402Payment RequiredZero credit balance
422UnprocessableValidation error (file type, size, params)
429Too Many RequestsRate limit exceeded
500Server ErrorPipeline or infrastructure failure
503Service UnavailableOCR/LLM provider down or disabled

Error response format

{
  "error": "error_code",
  "message": "Human-readable description",
  "details": {}
}

Common error codes

errorDescription
invalid_api_keyBearer token missing or not recognised
insufficient_creditsBalance is 0
validation_failedInvalid file, document_type, or options
file_too_largeExceeds 50 MB
unsupported_media_typeNot a PDF
extraction_failedPipeline could not process document
rate_limit_exceededToo many requests per minute

Limits

LimitValue
Max file size50 MB
Rate limit60 req/min per API key
Default confidence threshold0.7
Cache TTL30 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 file in multipart form
  • document_type must be one of the supported enum values
  • webhook_url must be HTTPS in production