Skip to main content
Business Define a JSON schema on your inbox. When an email arrives, an LLM extracts the fields you specified and returns them as structured data in the message and webhook payload. No parsing or regex needed.

How it works

  1. You define a JSON schema on your inbox describing what to extract
  2. When an email arrives, Commune uses an LLM to extract data matching your schema
  3. The extracted data appears in message.metadata.extracted_data and webhook.extractedData
  4. Your agent uses the structured data directly — no parsing or regex needed

Configure extraction schema

Set a schema on your inbox to define what data to extract:

Schema parameters

Schema definition tips

  • Use description on every property — the LLM uses these to understand what to look for
  • Use enum for categorical fields — constrains output to valid values
  • Keep schemas focused — extract 3–8 fields per schema for best accuracy
  • Use type: "string" for dates — the LLM returns ISO strings; parse in your code

Example: extracted data in webhook

When a customer sends:
“Hi, my order #ORD-5678 hasn’t arrived yet. I ordered it 3 days ago and the tracking still shows ‘processing’. This is really frustrating. Can you please look into this urgently?”
Your webhook receives:
Your agent can now route this directly — look up order ORD-5678, check shipping status, and send a targeted response, all without parsing the email text.

Use case examples

E-commerce support

SaaS onboarding

Invoice processing

Disable extraction

Configure structured extraction on an inbox via MCP

Open in Cursor

Extraction object on inbox

When an extraction schema is configured, the inbox object includes:
Structured extraction is a paid feature available on Pro plans and above.

What’s next?

Webhooks

Access extracted data in the webhook payload on every inbound email.

Inboxes

Configure extraction schemas on individual inboxes.

Prompt Injection Detection

Protect your agent from adversarial content in inbound emails.

Search

Search threads by semantic meaning using extracted data.
Last modified on March 19, 2026