Create a .zip file
Create .zip is an API that bundles several files (any type: PDFs, images, spreadsheets…) into a single .zip. Great for packaging a flow's output before emailing it from n8n, Make or Zapier, with no servers to maintain.
How it works
You send a list of files, each with its name and its content in base64, and get back a single .zip with all of them inside. Nothing is stored: it's generated on the fly.
Since it's several files at once, this tool only accepts a JSON body (there's no "paste the raw file" mode).
All you need
- Your API key. Create it in your dashboard with "+ Create key". It's shown only once, so copy and save it.
- In your automation platform, an "HTTP Request" step (n8n, Make, Zapier, Pipedream… all have one).
- Each file converted to base64 before sending it.
How to use it in n8n (step by step)
In the HTTP Request node:
- Method:
POST - URL:
https://api.cofferdock.com/create-zip - Send Headers: on → add two:
x-api-key= your key, andContent-Type=application/json - Send Body: on → Body Content Type: JSON →
{ "files": [{ "name": "invoice.pdf", "content": "<base64>" }, { "name": "photo.jpg", "content": "<base64>" }] } - Under Options → Response → Response Format: choose File (the response is already the .zip)
If a file arrives as binary data from an earlier step, convert it to base64 with a Code node using {{'{{'}}$binary.data.toString('base64'){{'}}'}}, or with the Move Binary Data node.
In Make (HTTP → Make a request module): same method and URL, Body type: Raw, Content type: JSON, with the same files array.
Options (inside the JSON)
| Option | Default | What it does |
|---|---|---|
files | - | Required. Array of 1 to 50 files, each { "name": "...", "content": "<base64>" }. |
output | binary | Set to json to receive the .zip as base64 inside a JSON instead of the raw file. |
API overview
- Endpoint:
POST https://api.cofferdock.com/create-zip - Auth: header
x-api-key: YOUR_KEY. - Input:
application/jsonONLY:{ "files": [{ "name", "content" }, ...] }, 1 to 50 files. - Output: by default the binary (
application/zip) directly; with"output": "json"it returns JSON with the zip in base64. - Limits: the full JSON body (all base64 files together) is capped at 6 MB, meaning about 4 MB of real combined files. 30 requests/min per IP. 1 zip = 1 credit, no matter how many files it contains.
Options
| Option | Default | Description |
|---|---|---|
files | - | Required. Array of 1 to 50 { name, content } objects. name can't be empty, start with /, or contain .. as a path segment (400 otherwise). |
output | binary | binary (raw .zip) or json (base64). |
Examples
curl (base64-encode two files and build the zip):
B64_1=$(base64 -w0 invoice.pdf)
B64_2=$(base64 -w0 photo.jpg)
curl -X POST "https://api.cofferdock.com/create-zip" \
-H "x-api-key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d "{\"files\":[{\"name\":\"invoice.pdf\",\"content\":\"$B64_1\"},{\"name\":\"photo.jpg\",\"content\":\"$B64_2\"}]}" \
-o archive.zip
JavaScript (Node 18+):
const fs = require('fs');
const files = [
{ name: 'invoice.pdf', content: fs.readFileSync('invoice.pdf').toString('base64') },
{ name: 'photo.jpg', content: fs.readFileSync('photo.jpg').toString('base64') },
];
const r = await fetch('https://api.cofferdock.com/create-zip', {
method: 'POST',
headers: { 'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ files }),
});
fs.writeFileSync('archive.zip', Buffer.from(await r.arrayBuffer()));
Python:
import base64, requests
def as_file(name, path):
return {'name': name, 'content': base64.b64encode(open(path, 'rb').read()).decode()}
r = requests.post(
'https://api.cofferdock.com/create-zip',
headers={'x-api-key': 'YOUR_KEY', 'Content-Type': 'application/json'},
json={'files': [as_file('invoice.pdf', 'invoice.pdf'), as_file('photo.jpg', 'photo.jpg')]},
)
open('archive.zip', 'wb').write(r.content)
Response with output=json
{ "success": true, "zip": "UEsDBBQAAAAIAA…", "mime_type": "application/zip",
"meta": { "files_zipped": 2, "used": 12, "remaining": 488 } }
What you get back
By default, the .zip file itself, ready to save or send. With "output": "json" you get it as base64 inside a JSON object.