Skip to content

Synchronous Extraction

  • Path: POST /api/v1/extractFields
  • Method: POST
  • Authorization: api-key <environment-api-key>

Send one of:

  1. multipart/form-data
  2. application/json with base64 file data in top-level file

Supported top-level fields:

  1. file required
  2. filename optional for JSON base64 uploads
  3. templateName required unless filterName is used
  4. filterName optional
  5. documentSplitting optional boolean
  6. returnDocuments optional boolean
  7. returnText optional boolean
  8. schemaChunking optional: auto or combined
  9. password optional string for protected documents

Contract rules enforced by the runtime:

  1. Nested options.* is rejected
  2. returnBoundingBoxes is deprecated and ignored; new clients should omit it
  3. Only the fields listed in this guide are part of the client-facing contract
  4. JSON/base64 uploads should use a full data URL so the file type is explicit

Successful response:

{
"success": true,
"data": {
"completionTime": 2.31,
"originalName": "invoice.pdf",
"processedPages": 1,
"documents": [
{
"extracted": true,
"documentName": "Invoice",
"averageDocumentConfidence": 0.98,
"sourcePages": [1],
"content": {}
}
]
}
}

Each documents[] item may also include:

  1. message
  2. reason
  3. returnedDocumentBase64 when returnDocuments=true
  4. returnedText when returnText=true
  5. usedTemplateName
  1. 200 OK extraction completed
  2. 400 Bad Request invalid request shape or invalid option values
  3. 401 Unauthorized missing or invalid API key
  4. 404 Not Found requested template/filter-scoped resource not found
  5. 429 Too Many Requests sync extraction capacity guard rejected the request
Terminal window
curl -X POST "$BASE_URL/api/v1/extractFields" \
-H "Authorization: api-key $API_KEY" \
-F "file=@invoice.pdf" \
-F "templateName=invoice" \
-F "returnText=true"
{
"success": true,
"data": {
"completionTime": 2.31,
"originalName": "invoice.pdf",
"processedPages": 1,
"documents": [
{
"extracted": true,
"documentName": "Invoice",
"averageDocumentConfidence": 0.98,
"sourcePages": [1],
"content": {},
"returnedText": "Invoice Number: INV-1001"
}
]
}
}