Free plan

E-mail to JSON

Read an e-mail file: sender, subject, text and attachments
POST
/v1/documents/email

About this tool

This tool opens a saved e-mail file (.eml, or .msg from Outlook) and shows what is in it: who sent it and to whom, the subject, the dates, the message text, the links, and the names of the attachments. It does not send e-mail or open attachments. You can choose to include the original page code and all technical headers.
For example, you saved an old e-mail and want its text and the list of attachments without opening your mail program.

How to use it

  1. Choose this tool.
  2. Add your .eml or .msg file with Upload or drag and drop.
  3. Choose what to include, such as the text, the links or the full headers.
  4. Press Generate.
  5. Read the result on screen or copy it.

What you get back

You get the details of the e-mail as a structured list on screen. You can copy it or download it.
GOOD TO KNOW
No result file: the answer is data. Nothing in the message is fetched or run and attachments are only listed. Counts as one document.
TEST IT LIVE

Try E-mail to JSON in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/email
Tool ID
documents.email
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/email" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'include_text=true' \
  -F 'include_html=false' \
  -F 'max_text_chars=0'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.email({
    "file": 'document.pdf',
    "include_text": true,
    "include_html": false,
    "max_text_chars": 0
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->email([
    'file' => 'document.pdf',
    'include_text' => true,
    'include_html' => false,
    'max_text_chars' => 0,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Read an e-mail message (.eml or Outlook .msg) as data: who sent it and to whom, the subject, the dates, the ids that link a conversation, the text, the links and the list of attachments.

E-mail to JSON works from text and settings, so no file is needed. Every input is optional.

E-mail to JSON is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/email with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.