Extract expiry data from a file already in Cloud Storage

posthttps://api.expiryedge.com/v1/extractDocument
any role30/minAny method
Request
curl -X POST 'https://api.expiryedge.com/v1/extractDocument' \
  -H "Authorization: Bearer $EXPIRYEDGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "storagePath": "user_files/org_northwind/exp_4Tq9sLm2/business-license.pdf",
  "fileName": "business-license.pdf",
  "mimeType": "application/pdf"
}'
Response
{
  "success": true,
  "extraction": {
    "documents": [
      {
        "name": "Business License",
        "document_type": "license",
        "issuing_authority": "City of Seattle",
        "holder_name": "Northwind Dental LLC",
        "reference_number": "BL-2025-44817",
        "start_date": "2025-10-15",
        "expiry_date": "2026-10-15",
        "vendor": null,
        "notes": null,
        "confidence": "high",
        "extracted_fields": [
          {
            "label": "License Class",
            "value": "Health Services",
            "category": "legal"
          }
        ]
      }
    ]
  },
  "fileName": "business-license.pdf",
  "ai_scans": {
    "used": 8,
    "limit": 25,
    "remaining": 17,
    "resets_at": "2026-10-01T00:00:00.000Z"
  }
}

Uses 1 AI scan from the monthly quota. storagePath must be inside your organization's upload area (user_files/{orgId}/..., user_files/{uid}/{orgId}/... or organizations/{orgId}/...). Max 20MB. When the monthly AI scan quota is used up it returns 429 with an AiScanQuotaError body.

Body parameters

application/json
  • storagePathstringrequired
  • 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
Authenticated, but your role or organization does not allow this action.
404
The record does not exist or is not in your organization.
429
Too many requests for this endpoint from your IP. Wait Retry-After seconds.
500
Unexpected server error. Retry later; quote requestId to support.