Tools API Blog
Sign in Create account

Merge PDFs

Merge PDFs is an API that combines several PDFs into one, in the order you send them. Great for joining invoices, attachments or reports into a single file from n8n, Make or Zapier, with no servers to maintain.

How it works

You send two or more PDFs (base64-encoded, inside a JSON body) and get back a single PDF with every page from all of them, in the same order you sent them. Nothing is stored: the PDF is generated on the fly.

Unlike the other PDF tools, this one needs several files at once, so it only accepts a JSON body (there's no "paste the raw PDF" 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 PDF converted to base64 before sending it (see the step-by-step below).

The PDFs travel inside a JSON body, so all the files you merge together can't add up to more than about 4 MB combined. For bigger PDFs, shrink them first or merge in batches.

How to use it in n8n (step by step)

In the HTTP Request node:

  • Method: POST
  • URL: https://api.cofferdock.com/pdf-merge
  • Send Headers: on → add two: x-api-key = your key, and Content-Type = application/json
  • Send Body: on → Body Content Type: JSON → { "files": ["<first PDF base64>", "<second PDF base64>"], "output": "binary" }
  • Under Options → Response → Response Format: choose File (since you asked for output: "binary")

If the PDF arrives as binary data from an earlier step (say, from Google Drive or an email), convert it to base64 with a Code node using {{'{{'}}$binary.data.toString('base64'){{'}}'}}, or with the Move Binary Data node in "Binary to Property" mode.

In Make (HTTP → Make a request module): same method and URL, Headers with the two headers, Body type: Raw, Content type: JSON (application/json), and the same JSON with the files array in Request content. Make's "Get a file" module already gives you base64 content directly.

In short: POST to …/pdf-merge, headers x-api-key and Content-Type: application/json, a JSON body with files (array of base64 PDFs) and output: "binary", Response Format as File.

Options (inside the JSON)

OptionDefaultWhat it does
files-Required. Array of 2 to 20 base64 PDFs, in the order you want them merged.
outputjsonSet to binary to receive the PDF directly instead of base64.

What you get back

By default, a JSON object with the merged PDF in base64 plus data like the total page count. With "output": "binary" you get the PDF itself, ready to save or send.