---
title: "Merge multiple PDF files into one"
method: POST
path: "/api2/pdfmerge"
tags: ["PDF Merge"]
---

# Merge multiple PDF files into one

`POST /api2/pdfmerge`

Merges 2+ PDF inputs into a single output PDF. Each input is either uploaded as a
multipart form file (named `file_N`) or referenced by URL via `url_N`. Sync by default;
set `async=true` for background processing.

For multipart uploads the request body is `multipart/form-data`, the JSON body
equivalent describes the same fields plus an `input_files` array.

## Request body

- PdfMergeParameters
  - `key` string, uuid, required — License key.
  - `async` boolean
  - `timeout` integer — Per-input timeout in seconds (clamped to ~30–120).
  - `input_files` PdfMergeFile[] — List of inputs. Each entry is either an URL reference or a placeholder for a multipart-uploaded file (uploads use form fields `file_1`, `file_2`, …).
    - `file_type` 0 | 1 — 0 = uploaded file (multipart `file_<idx>`); 1 = URL reference (`url` field).
    - `idx` integer — 1-based index identifying which multipart field / merge slot this entry maps to.
    - `url` string — PDF URL when `file_type=1`. Empty when uploading.
    - `user_password` string — Password for opening the input PDF (if encrypted).
  - `pdf_name` string
  - `response_content_type` 0 | 1
  - `raw_parameters` string
  - `doc_title` string
  - `doc_subject` string
  - `doc_keywords` string
  - `doc_author` string
  - `doc_add_creation_date` boolean
  - `viewer_page_layout` integer
  - `viewer_page_mode` integer
  - `viewer_center_window` boolean
  - `viewer_display_doc_title` boolean
  - `viewer_fit_window` boolean
  - `viewer_hide_menu_bar` boolean
  - `viewer_hide_toolbar` boolean
  - `viewer_hide_window_ui` boolean
  - `user_password` string
  - `owner_password` string

## Response `200`

Merged PDF returned in the response body.

## Other responses

- `202` — Async accepted. Poll `/api2/asyncjob` with the returned `X-SelectPdf-Job-Id`.
- `400` — Missing files, fewer than 2 input files supplied, or other validation failure.
- `401` — Unauthorized.
- `429` — Concurrency throttled.
- `499` — Merge failed — bad PDF, wrong password, etc.

---

[API](https://skmtc.dev/selectpdf/apis/selectpdf-rest-api.md) · [All operations](https://skmtc.dev/selectpdf/apis/selectpdf-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/selectpdf/selectpdf-rest-api/revisions/3e8de86ac045/schema)
