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.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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.
Thetype/datarequest format is deprecatedRequests with
type(RAWTEXT,B64_TEXT,IMAGE,MULTI,EXCEL) anddatakeep working with the same results until 2 May 2027. After that date they are still served but no longer maintained. Move to theattachmentsformat before then: see Move from the type / data format.
Request
| Field | Type | Required | Description |
|---|---|---|---|
subject | string | No | Subject of the email |
emailBody | string | No | Body of the email, as plain text |
attachments | array | Yes | The files of the request. Use [] for a request with the email body only |
attachments[].name | string | Yes | File name, for example packing.xlsx. It is returned in the response so you can match each file |
attachments[].contentType | string | Yes | Media type of the file, for example application/pdf. For information only: the real type is detected from the file itself |
attachments[].content | string | Yes | The 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
typeordatatogether withattachments: the request is rejected with400 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.docxor 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" }
]| Field | Description |
|---|---|
index | Position of the file in the request (files found inside a saved email come after the files of the request) |
parentIndex | Only for a file found inside a saved email: the index of that email |
name | File name |
detectedType | Type detected from the file itself, for example pdf, xlsx, png |
status | processed, ignored, rejected or not_extracted |
reason | Why the file was ignored or rejected, for example unsupported_format, password_protected, executable, too_large, duplicate, signature_image, empty |
duplicateOf | Only 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" }
}
}| Status | error.type | Meaning |
|---|---|---|
| 400 | MIXED_FORMAT | type or data sent together with attachments. Use one format only |
| 400 | INVALID_ATTACHMENTS, INVALID_ATTACHMENT, MISSING_ATTACHMENT_SOURCE | attachments is not an array of objects, or an attachment has a missing, empty or unknown field |
| 400 | INVALID_BASE64 | The content of an attachment is not valid base64 |
| 413 | REQUEST_TOO_LARGE | The request is over 6 MB. Send fewer or smaller attachments |
| 422 | NO_USABLE_INPUT | No body, no subject and no usable file. See attachments for the status of each file |
| 502 | CONVERSION_FAILED | No body, no subject, and no file could be read because of a server-side failure. Try again |
| 504 | CONVERSION_TIMEOUT | No body, no subject, and no file could be read in time. Try again with fewer or smaller files |
| 502 | MODEL_ERROR | The extraction failed. Try again; if it persists, contact support |
| 503 | MODEL_ERROR | The extraction service is busy or unavailable. Retry later |
| 504 | MODEL_TIMEOUT | The extraction did not finish in time. Try again with fewer or smaller files |
| 500 | INTERNAL_ERROR | Internal 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 request | New request |
|---|---|
type: RAWTEXT, data: the email text | emailBody: the email text, attachments: [] |
type: B64_TEXT, data: the email text in base64 | emailBody: the email text (decoded), attachments: [] |
type: IMAGE, data: a base64 image | attachments: one entry with name, contentType (for example image/png) and the base64 image in content |
type: MULTI, data: a base64 image, emailBody: the email | emailBody: the email, attachments: one entry with the image |
type: EXCEL, data: a base64 Excel file | attachments: one entry with name (for example rates.xlsx), contentType and the base64 file in content |
subject | subject, 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).
