Developer guide

Email Parsing API

Use ParseForce when you need email parsing to behave like backend infrastructure: predictable payload shape, schema-driven extraction, and webhook delivery that fits existing queues and services.

Technical model

Each mailbox carries a schema, and extraction is constrained to that contract. That keeps downstream consumers aligned to declared fields rather than ad hoc regex output.

  • Schema fields can be nested objects or arrays.
  • Parsed output is delivered as JSON, not scraped text fragments.
  • Operational state is explicit: pending, parsed, failed, or needs schema.

What gets difficult at scale

Real email streams are noisy: forwarded threads, inconsistent formatting, and senders that change templates without warning.

  • Keep schemas narrow and task-specific.
  • Store the raw email alongside parsed fields for traceability.
  • Route mailbox-specific payloads to dedicated consumers when possible.

Schema design guidelines

Most parsing failures come from trying to make one schema cover too many email formats. Narrow schemas are easier to operate and debug.

  • Split mailboxes by workflow or sender pattern when formats diverge.
  • Start with required fields your downstream code actually uses.
  • Add nullable fields for optional metadata instead of overloading one contract.

Example JSON output

Example webhook payload shape for this workflow.

json

{
  "event": "email.parsed",
  "mailboxId": "mbx_ops_7",
  "parsedData": {
    "order_id": "PO-77419",
    "customer": "Lakeside Retail",
    "items": [
      {
        "sku": "VK-220",
        "quantity": 120
      },
      {
        "sku": "PR-88",
        "quantity": 40
      }
    ],
    "destination_city": "Denver",
    "destination_state": "CO"
  },
  "rawEmail": {
    "from": "purchasing@lakeside-retail.com",
    "subject": "New store order"
  }
}

Node.js handler for parsed order payloads

Minimal Node.js example for consuming ParseForce output.

node.js

import express from "express";

const app = express();
app.use(express.json());

app.post("/webhooks/parseforce/orders", async (req, res) => {
  if (req.body.event !== "email.parsed") {
    return res.status(202).end();
  }

  const { order_id, items } = req.body.parsedData;

  const totalUnits = items.reduce((sum, item) => sum + item.quantity, 0);
  console.log("order:", order_id, "units:", totalUnits);

  return res.status(204).end();
});

app.listen(3000);

Related guides

Related ParseForce pages

Explore related ParseForce pages for webhook delivery, schema design, and implementation details for adjacent email automation workflows.

See the full product overview