Crear archivo .zip
Crear .zip es una API que junta varios archivos (de cualquier tipo: PDFs, imágenes, hojas de cálculo…) en un único .zip. Perfecto para empaquetar los resultados de un flujo antes de mandarlos por email desde n8n, Make o Zapier, sin montar servidores.
Cómo funciona
Le mandas una lista de archivos, cada uno con su nombre y su contenido en base64, y te devuelve un único .zip con todos ellos dentro. No guarda nada: se genera al momento.
Como son varios archivos a la vez, esta herramienta solo admite el cuerpo en JSON (no hay modo "pega el archivo a pelo").
Lo único que necesitas
- Tu API key. La creas en tu panel con "+ Crear llave". Se muestra una sola vez, así que cópiala y guárdala.
- En tu plataforma de automatización, un paso de tipo "HTTP Request" / "Hacer una petición HTTP" (lo tienen n8n, Make, Zapier, Pipedream…).
- Cada archivo convertido a base64 antes de mandarlo.
Cómo usarlo en n8n (paso a paso)
En el nodo HTTP Request:
- Method:
POST - URL:
https://api.cofferdock.com/create-zip - Send Headers: actívalo y añade dos:
x-api-key= tu llave, yContent-Type=application/json - Send Body: actívalo → Body Content Type: JSON →
{ "files": [{ "name": "factura.pdf", "content": "<base64>" }, { "name": "foto.jpg", "content": "<base64>" }] } - En Options → Response → Response Format: elige File (la respuesta ya es el .zip)
Si un archivo te llega como binario de un paso anterior, conviértelo a base64 con un nodo Code y la expresión {{'{{'}}$binary.data.toString('base64'){{'}}'}}, o con el nodo Move Binary Data.
En Make (módulo HTTP → Make a request): mismo método y URL, Body type: Raw, Content type: JSON, con el mismo array files.
Opciones (dentro del JSON)
| Opción | Por defecto | Para qué sirve |
|---|---|---|
files | — | Obligatorio. Array de 1 a 50 archivos, cada uno { "name": "...", "content": "<base64>" }. |
output | binary | Pon json para recibir el .zip en base64 dentro de un JSON en vez del archivo directo. |
Resumen de la API
- Endpoint:
POST https://api.cofferdock.com/create-zip - Auth: cabecera
x-api-key: TU_LLAVE. - Entrada: SOLO
application/json—{ "files": [{ "name", "content" }, ...] }, de 1 a 50 archivos. - Salida: por defecto el binario (
application/zip) directamente; con"output": "json"devuelve JSON con el zip en base64. - Límites: el JSON completo (todos los archivos en base64 juntos) tiene un tope de 6 MB, es decir, unos 4 MB reales combinados. 30 peticiones/min por IP. 1 zip = 1 crédito, sin importar cuántos archivos lleve.
Opciones
| Opción | Por defecto | Descripción |
|---|---|---|
files | — | Obligatorio. Array de 1 a 50 objetos { name, content }. name no puede estar vacío, empezar por / ni contener .. como segmento de ruta (400 si no cumple). |
output | binary | binary (.zip crudo) o json (base64). |
Ejemplos
curl (codifica dos archivos y crea el zip):
B64_1=$(base64 -w0 factura.pdf)
B64_2=$(base64 -w0 foto.jpg)
curl -X POST "https://api.cofferdock.com/create-zip" \
-H "x-api-key: TU_LLAVE" \
-H "Content-Type: application/json" \
-d "{\"files\":[{\"name\":\"factura.pdf\",\"content\":\"$B64_1\"},{\"name\":\"foto.jpg\",\"content\":\"$B64_2\"}]}" \
-o archivo.zip
JavaScript (Node 18+):
const fs = require('fs');
const files = [
{ name: 'factura.pdf', content: fs.readFileSync('factura.pdf').toString('base64') },
{ name: 'foto.jpg', content: fs.readFileSync('foto.jpg').toString('base64') },
];
const r = await fetch('https://api.cofferdock.com/create-zip', {
method: 'POST',
headers: { 'x-api-key': 'TU_LLAVE', 'Content-Type': 'application/json' },
body: JSON.stringify({ files }),
});
fs.writeFileSync('archivo.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': 'TU_LLAVE', 'Content-Type': 'application/json'},
json={'files': [as_file('factura.pdf', 'factura.pdf'), as_file('foto.jpg', 'foto.jpg')]},
)
open('archivo.zip', 'wb').write(r.content)
Respuesta con output=json
{ "success": true, "zip": "UEsDBBQAAAAIAA…", "mime_type": "application/zip",
"meta": { "files_zipped": 2, "used": 12, "remaining": 488 } }
Lo que recibes
Por defecto, el archivo .zip directamente, listo para guardar o enviar. Con "output": "json" lo recibes en base64 dentro de un JSON.
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.