/v1/intelligent/previewPreview the anonymized text the AI would see (no AI call)
Run the full PII anonymization pipeline on the supplied text and return the scrubbed version — exactly what would be sent to the AI model if you called `POST /v1/intelligent/parse` with the same input. This endpoint does **not** call the AI model, so it incurs no inference cost and does not count against your AI Parse quota. Use it to verify which identifiers (names, companies, VAT IDs, IBANs, emails, phones, addresses) are detected and masked before committing to a paid parse. The anonymization pipeline uses Microsoft Presidio with multilingual spaCy NER plus custom recognizers for EU VAT IDs and company legal forms. Supported languages: `en`, `de`, `pl`, `fr`, `it`, `es`, `nl`. Pass `language` to force a specific pipeline; otherwise the service auto-detects from the text. **Strict-mode guarantee:** `/preview` mirrors `/parse` — if the anonymization post-pass finds residual PII, the request is rejected with `422 UNANONYMIZED_PII_DETECTED` listing the coarse categories that must be manually redacted before retry. No AI call is ever made from `/preview`. Required scope: `einvoice:parse`.
Authentication
Requires API key via X-API-Key header.
Request body
textstringrequiredNatural language text to preview anonymization for
minLen 1 · maxLen 10000
languageanyoptionalOptional ISO 639-1 language hint (en, de, pl, fr, it, es, nl)
Example request
curl -X POST \
"https://einvoice.aethar.dev/api/v1/intelligent/preview" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"string"}'Responses
dataPreviewResultrequiredPreview of what the AI model would see after anonymization.
anonymized_textstringrequiredText with all detected PII replaced by format-preserving placeholders
detected_entity_countsobjectoptionalPer-entity-type counts (no PII values)
language_usedstringrequiredLanguage pipeline used for NER (auto-detected if not provided)
metadataMetadataSchemarequiredsourcesarray<SourceSchema>optionalnamestringrequiredData source name
urlanyoptionalURL to the source
request_idstringrequiredUnique request identifier
rate_limitanyoptionalerrorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
Try this endpoint
Create a free Aethar account and generate an API key in 2 minutes.
Create free account →