Email parsing API

Inbound emails are a firehose of structured intent trapped in unstructured text: order confirmations, lead inquiries, shipping notices, support requests. The AIDataParser email parsing API takes an email — as a PDF, an image, or its raw text rendered to a document — and returns the fields you care about: sender, subject, detected intent, and any entities like order numbers, amounts, dates, or contact details. You define the schema per email type and the response conforms to it.

This is the difference between writing regex for every sender's template and describing the outcome once. An order-confirmation parser pulls order ID, items, and total; a lead-intake parser pulls name, company, and request; a shipping-notice parser pulls carrier and tracking number. The same endpoint handles all of them because you supply the schema, not us.

For automation platforms, CRMs, and agent inboxes, this converts a mailbox into a stream of structured events. POST the email, get JSON back for one credit, and branch your workflow on the extracted intent field. The review_needed flag catches messages that don't fit any known pattern so they don't silently produce garbage downstream.

Fields you can extract from a email

fromstring

Sender email/name.

subjectstring

Email subject line.

intentstring

Detected purpose of the email.

order_numberstring

Order/reference ID if present.

amountnumber

Any monetary value mentioned.

entitiesarray

Extracted names, dates, IDs.

Example request

POST the email by URL, upload, or base64, with a JSON Schema describing the output you want.

curl -X POST https://aidataparser.com/v1/parse/document \
  -H "Authorization: Bearer adp_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/email.pdf",
    "schema": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "intent": {
          "type": "string",
          "enum": [
            "order_confirmation",
            "lead",
            "support",
            "shipping",
            "other"
          ]
        },
        "order_number": {
          "type": "string"
        },
        "amount": {
          "type": "number"
        }
      }
    }
  }'

Example response

The data field is guaranteed to match your schema.

{
  "object": "parse.document",
  "data": {
    "from": "orders@shop.example",
    "subject": "Your order #A1099 is confirmed",
    "intent": "order_confirmation",
    "order_number": "A1099",
    "amount": 89.99
  },
  "confidence": "high",
  "review_needed": false,
  "credits_charged": 1,
  "credits_remaining": 49
}

FAQ

Can I classify the email's intent?

Yes. Add an intent field with an enum of your categories (order, lead, support, shipping, other) and the API returns the best-fit class so your workflow can branch on it.

How do I send an email to the API?

Render the email to a PDF or image, or pass its text as a document, then POST it by URL, upload, or base64. Define which fields to extract in your schema.

What if an email doesn't match any known pattern?

The intent falls back to your catch-all value and review_needed is set, so unmatched messages are flagged rather than silently mis-parsed. Failed extractions aren't charged.

More document types