We are in official beta.
Email & Web
Send emails, parse EML files, and capture web pages
4 endpoints in this category. All require X-API-Key header.
Send Email
POST
/api/SendEmail
1 token
Send HTML email via Microsoft Graph API.
Requires GRAPH_TENANT_ID, GRAPH_CLIENT_ID, GRAPH_CLIENT_SECRET, GRAPH_SENDER_EMAIL. Sending limits (#1516): accounts on a free or trial plan are in SANDBOX MODE and may only mail their own account address and any address confirmed through a verification link — so you can test the endpoint end to end before you buy — and are capped at 5 recipients per message and 20 recipients per UTC day. Paid plans send to any recipient, capped at 50 per message and 500 (Starter) / 2,500 (Small Business) / 10,000 (Enterprise) recipients per UTC day. to, cc and bcc all count, and are all restricted. Recipients must be bare addresses: a display name ("Name" <a@b>) is refused on every plan, as is replyTo carrying one. A recipient on a reserved domain (.test, .example, .invalid, .localhost) is never mailed and comes back under "suppressed" (#1881). Attachment limits (#1995), counted in decoded file bytes and checked before the message is sent: free and trial plans may attach 5 files per message, 1.0 MB each, 2.0 MB in total; paid plans may attach 10 files per message, 2.5 MB each, 2.5 MB in total. Microsoft Graph refuses any message whose whole request exceeds 4 MB, so no plan and no setting goes above 2.5 MB of attachments. Every attachment is typed from its own first bytes: a file declared as an image whose contents are not an image is refused, and the detected type is what travels on the message. Refusals are 403 RECIPIENT_NOT_ALLOWED_SANDBOX / RECIPIENT_LIMIT_EXCEEDED / RECIPIENT_DISPLAY_NAME_NOT_ALLOWED, 413 TOO_MANY_ATTACHMENTS / ATTACHMENT_TOO_LARGE / ATTACHMENTS_TOO_LARGE, 415 ATTACHMENT_TYPE_MISMATCH and 429 SEND_EMAIL_DAILY_LIMIT — branch on code, never on the message — and a refused call is not billed.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
to |
array | required | Recipient(s) |
subject |
string | required | Subject line |
body |
string | required | HTML body |
cc |
array | optional | CC recipients |
bcc |
array | optional | BCC recipients |
attachments |
array | optional | Array of {name, contentType, content} |
importance |
string | optional | normal, high, low |
Request Example
JSON
{"to": ["recipient@example.com"], "subject": "Test from DocFlow", "body": "<h1>Hello</h1><p>Sent via DocFlow API.</p>"}
Response Example
JSON
{"success": true, "message": "Email sent successfully", "recipients": {"to": ["recipient@example.com"], "cc": [], "bcc": []}, "suppressed": [], "subject": "Test from DocFlow", "attachmentCount": 0, "timing": {"total": 812}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/SendEmail" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"to": ["recipient@example.com"], "subject": "Test from DocFlow", "body": "<h1>Hello</h1><p>Sent via DocFlow API.</p>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""to"": [""recipient@example.com""], ""subject"": ""Test from DocFlow"", ""body"": ""<h1>Hello</h1><p>Sent via DocFlow API.</p>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.docbutterfly.com/api/SendEmail", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://api.docbutterfly.com/api/SendEmail"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"to": ["recipient@example.com"], "subject": "Test from DocFlow", "body": "<h1>Hello</h1><p>Sent via DocFlow API.</p>"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://api.docbutterfly.com/api/SendEmail
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "to": [
│ "recipient@example.com"
│ ],
│ "subject": "Test from DocFlow",
│ "body": "\u003Ch1\u003EHello\u003C/h1\u003E\u003Cp\u003ESent via DocFlow API.\u003C/p\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/SendEmail"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededParse Email
POST
/api/ParseEmail
1 token
Parse EML/MIME email metadata.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | required | Base64 EML or raw MIME |
Request Example
JSON
{"email": "<base64-eml>"}
Response Example
JSON
{"success": true, "from": {"name": "Dana Reed", "address": "sender@test.com"}, "to": [{"name": "", "address": "recipient@test.com"}], "cc": [], "bcc": [], "subject": "Test", "date": "2026-09-05T14:02:11.000Z", "messageId": "<a1b2c3@test.com>", "inReplyTo": "", "references": [], "textBody": "Hello, the invoice is attached.", "htmlBody": "", "headers": {"subject": "Test", "date": "2026-09-05T14:02:11.000Z", "message-id": "<a1b2c3@test.com>", "mime-version": "1.0", "content-type": {"value": "multipart/mixed", "params": {"boundary": "BOUND1"}}}, "attachmentCount": 1, "hasAttachments": true, "timing": {"total": 38, "parse": 16}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ParseEmail" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"email": "<base64-eml>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""email"": ""<base64-eml>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.docbutterfly.com/api/ParseEmail", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://api.docbutterfly.com/api/ParseEmail"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"email": "<base64-eml>"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://api.docbutterfly.com/api/ParseEmail
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "email": "\u003Cbase64-eml\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ParseEmail"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededExtract Email Attachments
POST
/api/ExtractEmailAttachments
1 token
Extract attachments from EML file.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
email |
string | required | Base64 EML or raw MIME |
Request Example
JSON
{"email": "<base64-eml>"}
Response Example
JSON
{"success": true, "attachments": [{"filename": "report.pdf", "contentType": "application/pdf", "size": 12345, "content": "JVBERi0xLjcK...", "contentId": "", "related": false}], "count": 1, "totalSize": 12345, "timing": {"total": 22, "parse": 22}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ExtractEmailAttachments" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"email": "<base64-eml>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""email"": ""<base64-eml>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.docbutterfly.com/api/ExtractEmailAttachments", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://api.docbutterfly.com/api/ExtractEmailAttachments"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"email": "<base64-eml>"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://api.docbutterfly.com/api/ExtractEmailAttachments
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "email": "\u003Cbase64-eml\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ExtractEmailAttachments"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededCapture Web Page
POST
/api/CaptureWebPage
2 tokens
Capture a URL as PDF or screenshot.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url |
string | required | URL to capture |
output |
string | optional |
pdf or screenshot
(default: pdf)
|
options.captureMode |
string | optional |
screen (full visual fidelity), print (traditional), fast (minimal wait)
(default: screen)
|
options.pageSize |
string | optional |
Named paper size — see the paper-size table on the API reference overview. Case- and punctuation-insensitive; aliases such as "US Letter" are accepted. Via raw JSON a custom size object is also accepted: {"width": n, "height": n, "units": "pt|px|in|mm|cm"} (units default pt; 1-14400pt / 200in per side). An unknown size, unit, or orientation returns 400 — nothing silently falls back. PDF output only; legacy key options.format is still accepted
(default: Letter)
|
options.orientation |
string | optional | Page orientation. "landscape" puts the long edge horizontal. Omit to keep the size's own orientation (portrait for every named size except Ledger) |
options.fullPage |
boolean | optional | Full page capture |
options.viewport |
object | optional | {width, height} in pixels |
options.timeout |
number | optional |
Navigation timeout in ms (max 60000)
(default: 30000)
|
returnBase64 |
boolean | optional |
Return base64
(default: true)
|
Request Example
JSON
{"url": "https://example.com", "output": "pdf", "options": {"pageSize": "Letter"}, "returnBase64": true}
Response Example
PDF
{"success": true, "data": "JVBERi0xLjcK...", "contentType": "application/pdf", "url": "https://example.com", "outputType": "pdf", "pageSize": {"name": "Letter", "width": 612, "height": 792, "orientation": "portrait"}, "timing": {"total": 2143, "launch": 1502, "navigation": 480}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/CaptureWebPage" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "output": "pdf", "options": {"pageSize": "Letter"}, "returnBase64": true}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""url"": ""https://example.com"", ""output"": ""pdf"", ""options"": {""pageSize"": ""Letter""}, ""returnBase64"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.docbutterfly.com/api/CaptureWebPage", content);
response.EnsureSuccessStatusCode();
// The response contains a base64-encoded file in the JSON body
var result = await response.Content.ReadAsStringAsync();
using var doc = System.Text.Json.JsonDocument.Parse(result);
var base64 = doc.RootElement.GetProperty("pdf").GetString();
var bytes = Convert.FromBase64String(base64!);
await File.WriteAllBytesAsync("output.pdf", bytes);import requests
import json
import base64
url = "https://api.docbutterfly.com/api/CaptureWebPage"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"url": "https://example.com", "output": "pdf", "options": {"pageSize": "Letter"}, "returnBase64": true}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
# Decode the base64 PDF and save to file
data = response.json()
pdf_bytes = base64.b64decode(data["pdf"])
with open("output.pdf", "wb") as f:
f.write(pdf_bytes)
print("Saved to output.pdf")┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://api.docbutterfly.com/api/CaptureWebPage
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "url": "https://example.com",
│ "output": "pdf",
│ "options": {
│ "pageSize": "Letter"
│ },
│ "returnBase64": true
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/CaptureWebPage"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
To save the output file:
7. Add a "Parse JSON" action on the HTTP response body
8. Use base64ToBinary(body('Parse_JSON')?['pdf']) to convert
9. Pass the result to a "Create file" action (SharePoint, OneDrive, etc.)