Developer guide

Email to JSON

ParseForce converts inbound email into structured JSON so your backend can work with typed fields instead of raw message text. Define the fields you need, send email to a mailbox, and receive JSON at your webhook.

Why teams convert email to JSON

Most operational email workflows break because the source is semi-structured while the destination expects fields. JSON is the format that lets downstream services stay predictable.

  • Move away from manual copy and paste into internal tools.
  • Push email-derived fields into queues, APIs, or databases.
  • Preserve the original email metadata while standardizing the extracted output.

What the JSON contract should include

The useful output is not every sentence in the email. It is the subset of fields your backend actually depends on.

  • Use required fields for values that must exist before downstream processing.
  • Keep optional fields nullable when senders omit them.
  • Group related values into nested objects or arrays instead of flattening everything.

How ParseForce handles the conversion

ParseForce sits between inbound email and your backend endpoint. Each mailbox has a schema, and parsed output is delivered as JSON instead of raw MIME or thread text.

  • Use one mailbox per workflow when formats differ.
  • Inspect parsed payloads and delivery logs from the dashboard.
  • Replay webhook deliveries when downstream systems need a retry.

Example JSON output

Example webhook payload shape for this workflow.

json

{
  "event": "email.parsed",
  "mailboxId": "mbx_json_12",
  "parsedData": {
    "sender_type": "supplier",
    "order_reference": "PO-5518",
    "tracking_number": "BLF-90211",
    "total": 1284.5,
    "currency": "USD",
    "due_date": "2026-02-29"
  },
  "rawEmail": {
    "from": "billing@northstar-industrial.com",
    "subject": "February shipment + payment details"
  }
}

Node.js email to JSON example

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/email-json", async (req, res) => {
  if (req.body.event !== "email.parsed") {
    return res.status(202).end();
  }

  const payload = req.body.parsedData;

  await queueEmailEvent({
    reference: payload.order_reference,
    trackingNumber: payload.tracking_number,
    total: payload.total,
    currency: payload.currency,
  });

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

async function queueEmailEvent(event) {
  console.log("queued email json", event);
}

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