POST/v1/merge
Merge PDFs into one, in order, optionally taking only some pages of each
Each file can be an id, a URL or base64, with pages to take part of it ("1-3,7") and password if it is encrypted. Form fields come through and stay fillable; a field name used twice gets _2, _3. Send the files as multipart (-F file=@a.pdf -F file=@b.pdf) to skip uploading.
REQUEST BODY · APPLICATION/JSON · REQUIRED
{
"files": [
"fil_8kq2wzm4tnb7hdc3vrex",
{
"url": "https://example.com/terms.pdf",
"pages": "1-2"
}
],
"name": "contract-with-terms.pdf"
}
REQUEST
curl -X POST "https://api.pdfedge.com/v1/merge" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
"fil_8kq2wzm4tnb7hdc3vrex",
{
"url": "https://example.com/terms.pdf",
"pages": "1-2"
}
],
"name": "contract-with-terms.pdf"
}'
import requests
r = requests.post("https://api.pdfedge.com/v1/merge", headers={"X-API-Key": "YOUR_KEY"}, json={
"files": [
"fil_8kq2wzm4tnb7hdc3vrex",
{
"url": "https://example.com/terms.pdf",
"pages": "1-2"
}
],
"name": "contract-with-terms.pdf"
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.pdfedge.com/v1/merge", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"files": [
"fil_8kq2wzm4tnb7hdc3vrex",
{
"url": "https://example.com/terms.pdf",
"pages": "1-2"
}
],
"name": "contract-with-terms.pdf"
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200With response=binary: the file itself, with X-File-Id and X-File-Url headers
201Created
{
"id": "fil_8kq2wzm4tnb7hdc3vrex",
"object": "file",
"kind": "result",
"operation": "merge",
"name": "merged.pdf",
"format": "pdf",
"content_type": "application/pdf",
"pages": 12,
"bytes": 284113,
"url": "https://files.pdfedge.com/f/fil_8kq2wzm4tnb7hdc3vrex.pdf",
"keep": "1d",
"created": "2026-10-11T18:10:40Z",
"expires": "2026-10-12T18:10:40Z",
"units": 1
}