We are in official beta.

Archive

Create and extract ZIP archives

5 endpoints in this category. All require X-API-Key header.


Create ZIP

POST /api/CreateZip 1 token

Create a ZIP archive from multiple files.

Parameters
NameTypeRequiredDescription
files array required Array of {name, content (base64)}
compression string optional deflate or store (default: deflate)
level number optional Deflate level 0-9 (default: 6)
Request Example
JSON
{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}
Response Example
JSON
{"success": true, "result": {"zip": "UEsDBBQAAAA...", "fileCount": 2, "size": 4096}, "timing": {"total": 18}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/CreateZip" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""files"": [{""name"": ""file1.txt"", ""content"": ""SGVsbG8=""}, {""name"": ""file2.txt"", ""content"": ""V29ybGQ=""}]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/CreateZip", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/CreateZip"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"files": [{"name": "file1.txt", "content": "SGVsbG8="}, {"name": "file2.txt", "content": "V29ybGQ="}]}')

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/CreateZip
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "files": [
│        {
│          "name": "file1.txt",
│          "content": "SGVsbG8="
│        },
│        {
│          "name": "file2.txt",
│          "content": "V29ybGQ="
│        }
│      ]
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/CreateZip"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Extract ZIP

POST /api/ExtractZip 1 token

Extract all files from a ZIP archive.

Parameters
NameTypeRequiredDescription
zip string required Base64-encoded ZIP
Request Example
JSON
{"zip": "<base64-zip>"}
Response Example
JSON
{"success": true, "result": {"files": [{"name": "file1.txt", "content": "SGVsbG8=", "size": 5}], "fileCount": 1, "totalSize": 5}, "timing": {"total": 11}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ExtractZip" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"zip": "<base64-zip>"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""zip"": ""<base64-zip>""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ExtractZip", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ExtractZip"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>"}')

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/ExtractZip
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "zip": "\u003Cbase64-zip\u003E"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ExtractZip"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Extract ZIP (Advanced)

POST /api/ExtractZipV2 1 token

Extract ZIP with filtering and path options.

Parameters
NameTypeRequiredDescription
zip string required Base64-encoded ZIP
filter string optional Glob pattern to filter
flatExtract boolean optional Ignore the folder structure and return every entry by file name alone (default: false)
maxFiles number optional Stop after this many entries; 0 means no limit (default: 0)
Request Example
JSON
{"zip": "<base64-zip>", "filter": "*.pdf", "flatExtract": true}
Response Example
JSON
{"success": true, "result": {"files": [{"name": "invoice.pdf", "path": "invoice.pdf", "size": 20481, "content": "JVBERi0xLjcK..."}], "fileCount": 1, "totalSize": 20481}, "timing": {"total": 26}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ExtractZipV2" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"zip": "<base64-zip>", "filter": "*.pdf", "flatExtract": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""zip"": ""<base64-zip>"", ""filter"": ""*.pdf"", ""flatExtract"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ExtractZipV2", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ExtractZipV2"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>", "filter": "*.pdf", "flatExtract": true}')

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/ExtractZipV2
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "zip": "\u003Cbase64-zip\u003E",
│      "filter": "*.pdf",
│      "flatExtract": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ExtractZipV2"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Update ZIP Entry

POST /api/UpdateZipEntry 1 token

Replace one named entry inside an existing ZIP. Every other entry is preserved byte-for-byte.

Parameters
NameTypeRequiredDescription
zip string required Base64-encoded ZIP
path string required Entry path inside the archive, e.g. data/proposal-data.json
contentText string optional New content as a UTF-8 string (e.g. JSON)
content string optional Or: new content, base64-encoded
entries array optional Or: array of {path, content|contentText} to replace several in one call
createIfMissing boolean optional Insert the path if it is not already in the archive (default: false)
compression string optional deflate or store (written entries only) (default: deflate)
level number optional 0-9 (default: 6)
Request Example
JSON
{"zip": "<base64-zip>", "path": "data/proposal-data.json", "contentText": "{\"client\":\"Contoso\"}"}
Response Example
JSON
{"success": true, "result": {"zip": "UEsDBBQAAAA...", "size": 40960, "entryCount": 15, "replaced": ["data/proposal-data.json"], "created": [], "preservedCount": 14, "normalizedHeaders": []}, "timing": {"total": 22}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/UpdateZipEntry" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"zip": "<base64-zip>", "path": "data/proposal-data.json", "contentText": "{\"client\":\"Contoso\"}"}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""zip"": ""<base64-zip>"", ""path"": ""data/proposal-data.json"", ""contentText"": ""{\""client\"":\""Contoso\""}""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/UpdateZipEntry", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/UpdateZipEntry"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>", "path": "data/proposal-data.json", "contentText": "{\"client\":\"Contoso\"}"}')

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/UpdateZipEntry
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "zip": "\u003Cbase64-zip\u003E",
│      "path": "data/proposal-data.json",
│      "contentText": "{\u0022client\u0022:\u0022Contoso\u0022}"
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/UpdateZipEntry"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed

Read ZIP Entry

POST /api/ReadZipEntry 1 token

Read one named entry out of a ZIP without extracting the whole archive.

Parameters
NameTypeRequiredDescription
zip string required Base64-encoded ZIP
path string required Entry path inside the archive
asText boolean optional Also return the entry decoded as a UTF-8 string (default: false)
Request Example
JSON
{"zip": "<base64-zip>", "path": "data/proposal-data.json", "asText": true}
Response Example
JSON
{"success": true, "result": {"path": "data/proposal-data.json", "name": "proposal-data.json", "size": 128, "compression": "deflate", "crc32": "3f7a1c05", "modified": "2026-01-15T10:30:00.000Z", "content": "eyJjbGll...", "contentText": "{\"client\":\"Contoso\"}"}, "timing": {"total": 6}}
Code Examples
curl -X POST "https://api.docbutterfly.com/api/ReadZipEntry" \
  -H "X-API-Key: df_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"zip": "<base64-zip>", "path": "data/proposal-data.json", "asText": true}'
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");

var json = @"{""zip"": ""<base64-zip>"", ""path"": ""data/proposal-data.json"", ""asText"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PostAsync("https://api.docbutterfly.com/api/ReadZipEntry", content);
response.EnsureSuccessStatusCode();

var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
import requests
import json

url = "https://api.docbutterfly.com/api/ReadZipEntry"
headers = {
    "X-API-Key": "df_your_api_key_here",
    "Content-Type": "application/json"
}
payload = json.loads('{"zip": "<base64-zip>", "path": "data/proposal-data.json", "asText": true}')

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/ReadZipEntry
│                                             │
│  Headers:                                   │
│    X-API-Key:    df_your_api_key_here       │
│    Content-Type: application/json           │
│                                             │
│  Body:                                      │
│    {
│      "zip": "\u003Cbase64-zip\u003E",
│      "path": "data/proposal-data.json",
│      "asText": true
│    }
│                                             │
└─────────────────────────────────────────────┘

Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://api.docbutterfly.com/api/ReadZipEntry"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed
Try in Testbed