Skip to main content
POST
Validate Document
Submit a base64-encoded document for asynchronous compliance validation.
Custom policy rules run automatically. Any rules you’ve activated via Activate Rules are applied on every validation for your API key — you do not select them via document_category or document_metadata. Those fields only choose which of ZeroDrift’s built-in (default) rule scenarios also run. To get your custom rules plus broad default coverage, use document_category: "scenario_all_general".

Request Body

document_bytes
string
required
Base64-encoded document content (PDF, DOCX, etc.)
document_category
string
Pre-defined category for the document. Required if document_metadata is not provided.Options: retail_investor_letter, retail_fact_sheet_registered_fund, retail_fact_sheet_non_registered, pitch_book_registered_fund, pitch_book_non_registered, scenario_retail_investor_letter, scenario_retail_fact_sheet_registered_fund, scenario_retail_fact_sheet_non_registered, scenario_pitch_book_registered_fund, scenario_pitch_book_non_registered, scenario_all_general, scenario_email_general, scenario_mnpi_focusedUse scenario_all_general for full coverage across all default rules (including MNPI detection).
document_metadata
object
Detailed metadata for precise rule matching. Required if document_category is not provided.
At least one of document_category or document_metadata must be provided.

Scanned PDF Support (OCR)

The validation service automatically handles scanned PDFs using AWS Textract OCR. No additional parameters are needed — OCR is triggered transparently when text extraction yields insufficient content. How it works:
  1. The service first attempts standard text extraction via pypdf
  2. If a page yields fewer than 50 characters, it is classified as a scanned/image page
  3. Scanned pages are automatically sent to AWS Textract for OCR
  4. The OCR text is merged with any text-extracted pages before validation
Three PDF cases: Limits:
Scanned PDFs may take longer to process due to OCR. For direct uploads via this endpoint, OCR is performed page-by-page (sync). For large scanned documents (50+ pages), use the presigned URL workflow which enables asynchronous Textract processing with higher limits.

Response

job_id
string
Unique identifier for the validation job
status
string
Job status: accepted
message
string
Status message
timestamp
string
ISO 8601 timestamp

Example