Extract expiry data from a base64-encoded file

posthttps://api.expiryedge.com/v1/extractDocumentDirect
any role30/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/extractDocumentDirect' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "base64Data": "JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFI+PgpzdHJlYW0K",
  "fileName": "malpractice-insurance.pdf",
  "mimeType": "application/pdf"
}'
Response
{
  "success": true,
  "extraction": {
    "documents": [
      {
        "name": "Professional Liability Policy",
        "document_type": "insurance",
        "issuing_authority": "Contoso Mutual",
        "holder_name": "Northwind Dental LLC",
        "reference_number": "PL-889120",
        "start_date": "2025-10-15",
        "expiry_date": "2026-10-15",
        "vendor": "Contoso Mutual",
        "notes": null,
        "confidence": "high",
        "extracted_fields": []
      }
    ]
  },
  "fileName": "malpractice-insurance.pdf",
  "ai_scans": {
    "used": 8,
    "limit": 25,
    "remaining": 17,
    "resets_at": "2026-10-01T00:00:00.000Z"
  }
}

The file is sent as base64 inside a JSON body (not multipart); max 10MB decoded. Uses 1 AI scan. Returns 403 ai_scan_feature_not_available when the plan has no AI scans. When the monthly AI scan quota is used up it returns 429 with an AiScanQuotaError body.

Body parameters

application/json
  • base64Datastringrequired
    Raw file bytes, base64 encoded, without a data: URL prefix.
  • fileNamestring
  • mimeTypestring
    Allowedapplication/pdfimage/pngimage/jpegimage/jpgimage/webpimage/gifimage/tiffDefault application/pdf

Returns

200
Extraction result.
  • successboolean
  • extractionobject
  • fileNamestring
  • ai_scansobject
    AI scan quota after this call.

Errors

400
The request is missing required fields or contains invalid values.
401
Missing, expired or invalid bearer token.
403
The organization's plan does not include AI scans.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.
500
Unexpected server error. Retry later; quote requestId to support.