Inkspan › Guides › Merge PDF API
Combine multiple PDFs into one in a single request — useful for stitching cover pages, appendices, or batched documents together programmatically.
Send the files field once per document. The order of the parts is the order of the output.
import requests
files = [
('files', open('first.pdf', 'rb')),
('files', open('second.pdf', 'rb')),
]
r = requests.post(
'https://api.inkspan.dev/v1/pdf/merge',
headers={'X-API-Key': 'ink_live_...'},
files=files,
)
r.raise_for_status()
with open('merged.pdf', 'wb') as f:
f.write(r.content)
| Name | Type | Required | Description |
|---|---|---|---|
files | file[] | yes | Two or more PDF files. Repeat the files field once per document — do not send an array in a single field. |
Returns a PDF as a binary stream with Content-Type: application/pdf and Content-Disposition: attachment; filename=merged.pdf. Write the response body straight to disk — do not parse it as JSON.
files twice rather than files[0] and files[1]; a single file returns a copy rather than an error.| Status | Meaning | Fix |
|---|---|---|
401 | Invalid or missing API key | Send your key in the X-API-Key header. |
402 | Monthly quota exceeded | The response reports used/quota. Upgrade at inkspan.dev/#pricing. |
422 | Missing or invalid parameter | Check required fields in the table above — the body names the offending field. |
Failed requests do not count against your quota; only successful ones are metered.
Yes — 100 documents a month, no card required. Usage-based plans start at $19/month when you outgrow it.
Send your key in the X-API-Key header on every request.
No. Only successful requests are metered.
Get a free API key →Full guides for /v1/pdf/merge: cURL · Python · Node.js · all guides