Shipment Data Extraction (Text, Image)

Transform raw email data into accurate shipment information and remove manual data entry from your quote and book process. By far the easiest way to leverage powerful AI capabilities to supercharge your workflows.

Send the email subject, its body and any number of attachments in one request (attachments format). The type / data format is deprecated: end of maintenance 2 May 2027. Errors are never billed.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Transform raw information into actionable insights effortlessly, as our API intelligently use AI system (chatGPT or others) reads and processes data, providing you with a powerful tool to enhance decision-making and streamline your workflow.

Send the email subject, its body and any number of attachments in one request, and retrieve one structured shipment enriched with comprehensive shipment information.

🚧

The type / data request format is deprecated

Requests with type (RAWTEXT, B64_TEXT, IMAGE, MULTI, EXCEL) and data keep working with the same results until 2 May 2027. After that date they are still served but no longer maintained. Move to the attachments format before then: see Move from the type / data format.

Request

FieldTypeRequiredDescription
subjectstringNoSubject of the email
emailBodystringNoBody of the email, as plain text
attachmentsarrayYesThe files of the request. Use [] for a request with the email body only
attachments[].namestringYesFile name, for example packing.xlsx. It is returned in the response so you can match each file
attachments[].contentTypestringYesMedia type of the file, for example application/pdf. For information only: the real type is detected from the file itself
attachments[].contentstringYesThe file, base64 encoded, without a data: prefix. An empty content is accepted and reported ignored with the reason empty
  • An attachment takes only these three fields: any other field is rejected.
  • The email and each file are read on their own, then combined into one shipment: every dimension line is returned, and an exact total weight stated in the documents wins over the sum of the lines.
  • Do not send type or data together with attachments: the request is rejected with 400 MIXED_FORMAT.

Supported formats

PDF (native and scanned), JPEG, PNG, HEIC, Excel (.xlsx, .xls, .xlsm), Word (.docx), PowerPoint (.pptx), CSV, TSV, RTF, HTML, plain text and saved emails (.eml, .msg, winmail.dat). The files inside a saved email are read too.

  • Old Word files (.doc) are not supported: send .docx or PDF.
  • Executables and scripts are rejected, also inside an email. Macros and embedded content are never run.
  • Duplicate files are read once.
  • Signature images, digital signatures, contact and calendar files, audio and video are ignored.

Limits

  • 6 MB per request, which is about 4.5 MB of files once base64 encoded. Above, the request is rejected with 413 REQUEST_TOO_LARGE.
  • No limit on the number of attachments.

Examples

{
  "subject": "Booking request",
  "emailBody": "Please book 2 pallets from CDG to BKK, 140x100x120 cm, 250 kg each. Delivery Thursday 5 November. Not stackable.",
  "attachments": []
}
{
  "subject": "Booking request",
  "emailBody": "Please book 2 pallets from CDG to BKK, delivery Thursday 5 November. Sizes and weights are in the packing list.",
  "attachments": [
    { "name": "packing.csv", "contentType": "text/csv", "content": "cGNzLGxlbmd0aCx3aWR0aCxoZWlnaHQsa2cKMiwxNDAsMTAwLDEyMCwyNTAK" },
    { "name": "notes.txt", "contentType": "text/plain", "content": "Tm90IHN0YWNrYWJsZS4K" }
  ]
}
{
  "subject": "Fwd: Booking request",
  "emailBody": "Please see the forwarded email.",
  "attachments": [
    { "name": "booking.eml", "contentType": "message/rfc822", "content": "RnJvbTogam9yZGFuLmxlZUBleGFtcGxlLmNvbQpUbzogb3BzQGV4YW1wbGUuY29tClN1YmplY3Q6IEJvb2tpbmcgcmVxdWVzdAoKUGxlYXNlIGJvb2sgMiBwYWxsZXRzIGZyb20gQ0RHIHRvIEJLSy4gTm90IHN0YWNrYWJsZS4K" }
  ]
}

Response

The response is the extracted shipment, plus an attachments list with the status of each file:

"attachments": [
  { "index": 0, "name": "packing.csv", "detectedType": "csv", "status": "processed" },
  { "index": 1, "name": "logo.png", "detectedType": "png", "status": "ignored", "reason": "signature_image" },
  { "index": 2, "name": "tool.exe", "detectedType": "executable", "status": "rejected", "reason": "executable" }
]
FieldDescription
indexPosition of the file in the request (files found inside a saved email come after the files of the request)
parentIndexOnly for a file found inside a saved email: the index of that email
nameFile name
detectedTypeType detected from the file itself, for example pdf, xlsx, png
statusprocessed, ignored, rejected or not_extracted
reasonWhy the file was ignored or rejected, for example unsupported_format, password_protected, executable, too_large, duplicate, signature_image, empty
duplicateOfOnly for a duplicate: the index of the file it duplicates

not_extracted means the file was read but the extraction failed or ran out of time (see the errors below). A file that cannot be read never fails the request: the other files are still used.

Errors

Errors use the format below. When the error is about one file, attachment gives its index, name and the faulty field.

{
  "error": {
    "type": "INVALID_BASE64",
    "description": "The attachment content is not valid base64",
    "attachment": { "index": 1, "name": "packing.csv", "field": "content" }
  }
}
Statuserror.typeMeaning
400MIXED_FORMATtype or data sent together with attachments. Use one format only
400INVALID_ATTACHMENTS, INVALID_ATTACHMENT, MISSING_ATTACHMENT_SOURCEattachments is not an array of objects, or an attachment has a missing, empty or unknown field
400INVALID_BASE64The content of an attachment is not valid base64
413REQUEST_TOO_LARGEThe request is over 6 MB. Send fewer or smaller attachments
422NO_USABLE_INPUTNo body, no subject and no usable file. See attachments for the status of each file
502CONVERSION_FAILEDNo body, no subject, and no file could be read because of a server-side failure. Try again
504CONVERSION_TIMEOUTNo body, no subject, and no file could be read in time. Try again with fewer or smaller files
502MODEL_ERRORThe extraction failed. Try again; if it persists, contact support
503MODEL_ERRORThe extraction service is busy or unavailable. Retry later
504MODEL_TIMEOUTThe extraction did not finish in time. Try again with fewer or smaller files
500INTERNAL_ERRORInternal error

When the extraction itself fails (MODEL_ERROR, MODEL_TIMEOUT), the response also carries the attachments list, with not_extracted for the files that were read:

{
  "error": {
    "type": "MODEL_ERROR",
    "description": "The extraction could not be completed because of a failure of the AI model service. No data was extracted and the request is not billed. Try again; if it persists, contact support"
  },
  "attachments": [
    { "index": 0, "name": "rates.csv", "status": "not_extracted", "detectedType": "csv" }
  ]
}

Credits

Errors are never charged, whatever the status. A file that could not be read is reported in the response and costs nothing. See Plans, Credits and API Keys for the cost of each call.

Move from the type / data format

Old requestNew request
type: RAWTEXT, data: the email textemailBody: the email text, attachments: []
type: B64_TEXT, data: the email text in base64emailBody: the email text (decoded), attachments: []
type: IMAGE, data: a base64 imageattachments: one entry with name, contentType (for example image/png) and the base64 image in content
type: MULTI, data: a base64 image, emailBody: the emailemailBody: the email, attachments: one entry with the image
type: EXCEL, data: a base64 Excel fileattachments: one entry with name (for example rates.xlsx), contentType and the base64 file in content
subjectsubject, unchanged
{ "type": "RAWTEXT", "data": "Please book 2 pallets..." }
{ "emailBody": "Please book 2 pallets...", "attachments": [] }

The type and data fields are still accepted until the end of maintenance, but never together with attachments (400 MIXED_FORMAT).

Body Params

Email subject, body and any number of attachments in one request; one consolidated shipment is returned. Supported files: PDF (native and scanned), JPEG, PNG, HEIC, Excel (.xlsx, .xls, .xlsm), Word (.docx), PowerPoint (.pptx), CSV, TSV, RTF, HTML, plain text and saved emails (.eml, .msg, winmail.dat). Limit: 6 MB per request (about 4.5 MB of files once base64 encoded), no limit on the number of attachments. Do not send type or data with attachments (400 MIXED_FORMAT).

string

Subject of the email.

string

Body of the email, as plain text.

attachments
array of objects
required

The files of the request. Use [] for a request with the email body only. An attachment takes only name, contentType and content: any other field is rejected.

attachments*
Headers
string
required
Responses

Language
LoadingLoading…
Response
Choose an example:
application/json