Word Operations
Template population, merge, extract, watermark, and manipulate DOCX documents
13 endpoints in this category. All require X-API-Key header.
Word Populate Template
/api/WordPopulateTemplate
1 token
Fill {placeholder} tags in a DOCX template with JSON data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
data |
object | required | Key-value pairs mapping placeholders to values |
Request Example
{"file": "<base64-docx>", "data": {"name": "John Doe", "company": "ACME Corp", "date": "2026-02-06"}}
Response Example
{"file": "UEsDBBQAAAA..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordPopulateTemplate" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "data": {"name": "John Doe", "company": "ACME Corp", "date": "2026-02-06"}}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""data"": {""name"": ""John Doe"", ""company"": ""ACME Corp"", ""date"": ""2026-02-06""}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordPopulateTemplate", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordPopulateTemplate"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "data": {"name": "John Doe", "company": "ACME Corp", "date": "2026-02-06"}}')
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://docbutterfly.com/api/WordPopulateTemplate
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "data": {
│ "name": "John Doe",
│ "company": "ACME Corp",
│ "date": "2026-02-06"
│ }
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordPopulateTemplate"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Merge Documents
/api/WordMergeDocuments
1 token
Combine multiple DOCX files into a single document with page breaks between them.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
files |
array | required | Array of base64-encoded DOCX files |
Request Example
{"files": ["<base64-docx-1>", "<base64-docx-2>"]}
Response Example
{"file": "UEsDBBQAAAA..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordMergeDocuments" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"files": ["<base64-docx-1>", "<base64-docx-2>"]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""files"": [""<base64-docx-1>"", ""<base64-docx-2>""]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordMergeDocuments", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordMergeDocuments"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"files": ["<base64-docx-1>", "<base64-docx-2>"]}')
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://docbutterfly.com/api/WordMergeDocuments
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "files": [
│ "\u003Cbase64-docx-1\u003E",
│ "\u003Cbase64-docx-2\u003E"
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordMergeDocuments"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Extract Text
/api/WordExtractText
1 token
Extract plain text content from a DOCX document.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
Request Example
{"file": "<base64-docx>"}
Response Example
{"text": "Document text content..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordExtractText" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordExtractText", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordExtractText"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>"}')
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://docbutterfly.com/api/WordExtractText
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordExtractText"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Extract Images
/api/WordExtractImages
1 token
Extract all embedded images from a DOCX document.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
Request Example
{"file": "<base64-docx>"}
Response Example
{"images": [{"name": "image1.png", "data": "iVBORw0...", "mimeType": "image/png"}], "count": 1}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordExtractImages" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordExtractImages", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordExtractImages"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>"}')
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://docbutterfly.com/api/WordExtractImages
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordExtractImages"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Extract Metadata
/api/WordExtractMetadata
1 token
Extract document properties and metadata from a DOCX file.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
Request Example
{"file": "<base64-docx>"}
Response Example
{"metadata": {"title": "Report", "creator": "John", "created": "2026-01-01"}}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordExtractMetadata" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordExtractMetadata", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordExtractMetadata"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>"}')
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://docbutterfly.com/api/WordExtractMetadata
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordExtractMetadata"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Add Text Watermark
/api/WordAddTextWatermark
1 token
Add a diagonal text watermark to a DOCX document.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
text |
string | required | Watermark text |
fontSize |
number | optional |
Font size in pt
(default: 72)
|
color |
string | optional |
Hex color without #
(default: CCCCCC)
|
Request Example
{"file": "<base64-docx>", "text": "CONFIDENTIAL", "fontSize": 72, "color": "CCCCCC"}
Response Example
{"file": "UEsDBBQAAAA..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordAddTextWatermark" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "text": "CONFIDENTIAL", "fontSize": 72, "color": "CCCCCC"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""text"": ""CONFIDENTIAL"", ""fontSize"": 72, ""color"": ""CCCCCC""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordAddTextWatermark", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordAddTextWatermark"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "text": "CONFIDENTIAL", "fontSize": 72, "color": "CCCCCC"}')
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://docbutterfly.com/api/WordAddTextWatermark
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "text": "CONFIDENTIAL",
│ "fontSize": 72,
│ "color": "CCCCCC"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordAddTextWatermark"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Add Image Watermark
/api/WordAddImageWatermark
1 token
Add an image watermark behind document content.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
image |
string | required | Base64-encoded image |
opacity |
number | optional |
Opacity 0-1
(default: 0.5)
|
Request Example
{"file": "<base64-docx>", "image": "<base64-image>", "opacity": 0.5}
Response Example
{"file": "UEsDBBQAAAA..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordAddImageWatermark" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "image": "<base64-image>", "opacity": 0.5}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""image"": ""<base64-image>"", ""opacity"": 0.5}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordAddImageWatermark", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordAddImageWatermark"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "image": "<base64-image>", "opacity": 0.5}')
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://docbutterfly.com/api/WordAddImageWatermark
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "image": "\u003Cbase64-image\u003E",
│ "opacity": 0.5
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordAddImageWatermark"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Find & Replace
/api/WordFindReplace
1 token
Find and replace text across a DOCX document including headers and footers.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
replacements |
array | required | Array of {find, replace} or object {find: replace} |
Request Example
{"file": "<base64-docx>", "replacements": [{"find": "{{name}}", "replace": "John Doe"}, {"find": "{{date}}", "replace": "2026-02-06"}]}
Response Example
{"file": "UEsDBBQAAAA...", "replacementCount": 4}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordFindReplace" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "replacements": [{"find": "{{name}}", "replace": "John Doe"}, {"find": "{{date}}", "replace": "2026-02-06"}]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""replacements"": [{""find"": ""{{name}}"", ""replace"": ""John Doe""}, {""find"": ""{{date}}"", ""replace"": ""2026-02-06""}]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordFindReplace", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordFindReplace"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "replacements": [{"find": "{{name}}", "replace": "John Doe"}, {"find": "{{date}}", "replace": "2026-02-06"}]}')
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://docbutterfly.com/api/WordFindReplace
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "replacements": [
│ {
│ "find": "{{name}}",
│ "replace": "John Doe"
│ },
│ {
│ "find": "{{date}}",
│ "replace": "2026-02-06"
│ }
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordFindReplace"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Set Metadata
/api/WordSetMetadata
1 token
Set document properties and metadata on a DOCX file.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
metadata |
object | required | {title, subject, creator, keywords, description, category} |
Request Example
{"file": "<base64-docx>", "metadata": {"title": "Updated Report", "creator": "DocFlow API"}}
Response Example
{"file": "UEsDBBQAAAA..."}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordSetMetadata" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "metadata": {"title": "Updated Report", "creator": "DocFlow API"}}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""metadata"": {""title"": ""Updated Report"", ""creator"": ""DocFlow API""}}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordSetMetadata", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordSetMetadata"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "metadata": {"title": "Updated Report", "creator": "DocFlow API"}}')
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://docbutterfly.com/api/WordSetMetadata
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "metadata": {
│ "title": "Updated Report",
│ "creator": "DocFlow API"
│ }
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordSetMetadata"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededWord Split Document
/api/WordSplitDocument
1 token
Split a DOCX at section breaks or page breaks into separate files.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file |
string | required | Base64-encoded DOCX file |
splitBy |
string | optional |
section or pagebreak
(default: section)
|
Request Example
{"file": "<base64-docx>", "splitBy": "section"}
Response Example
{"documents": [{"index": 0, "file": "UEsDBBQ..."}], "count": 3}
Code Examples
curl -X POST "https://docbutterfly.com/api/WordSplitDocument" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"file": "<base64-docx>", "splitBy": "section"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""file"": ""<base64-docx>"", ""splitBy"": ""section""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/WordSplitDocument", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/WordSplitDocument"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"file": "<base64-docx>", "splitBy": "section"}')
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://docbutterfly.com/api/WordSplitDocument
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "file": "\u003Cbase64-docx\u003E",
│ "splitBy": "section"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/WordSplitDocument"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededMarkdown to Word
/api/ConvertMarkdownToDocx
1 token
Convert Markdown text to a DOCX document. Supports three engines: mohtasham (default, best for business docs with TOC/page breaks), remark (best for code with syntax highlighting), vace (best for technical docs with math/footnotes).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
markdown |
string | required | Raw Markdown text |
engine |
string | optional |
mohtasham (default), remark, or vace
(default: mohtasham)
|
options |
object | optional | Engine-specific options (styling, theme, metadata) |
Request Example
{"markdown": "# Hello World\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2\n\n| Col A | Col B |\n|-------|-------|\n| 1 | 2 |", "engine": "mohtasham"}
Response Example
{"file": "UEsDBBQAAAA...", "engine": "mohtasham"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ConvertMarkdownToDocx" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2\n\n| Col A | Col B |\n|-------|-------|\n| 1 | 2 |", "engine": "mohtasham"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""markdown"": ""# Hello World\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2\n\n| Col A | Col B |\n|-------|-------|\n| 1 | 2 |"", ""engine"": ""mohtasham""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ConvertMarkdownToDocx", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ConvertMarkdownToDocx"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"markdown": "# Hello World\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2\n\n| Col A | Col B |\n|-------|-------|\n| 1 | 2 |", "engine": "mohtasham"}')
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://docbutterfly.com/api/ConvertMarkdownToDocx
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "markdown": "# Hello World\n\nThis is **bold** and *italic* text.\n\n- Item 1\n- Item 2\n\n| Col A | Col B |\n|-------|-------|\n| 1 | 2 |",
│ "engine": "mohtasham"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ConvertMarkdownToDocx"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed