---
title: Merge Multiple PDFs API
slug: merge-pdfs
url: https://apyhub.com/sarvasoft/service/merge-pdfs
provider: SARVASOFT OPC PRIVATE LIMITED
categories: [Ingestion Kit, Document Intelligence Kit, Output Kit]
tags: [pdf-merge, document-processing, file-conversion, pdf-combining]
auth: api_key
version: 2.0.0
service_type: sync
endpoints: 1
atoms: 15
mcp: true
---

# Merge Multiple PDFs API

Merge multiple PDFs API: send PDFs as base64 strings or public URLs and get one merged PDF back as a file, base64, JSON or a link. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/sarvasoft/merge-pdfs/pdf/merge` | What it does Merges several PDFs into one file. Send the PDFs as public URLs or Base64 in a JSON bo… | 15 |

## Endpoint reference

### Merge multiple PDF documents

`POST https://api.eu.apyhub.com/sarvasoft/merge-pdfs/pdf/merge` · 15 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `filename` | body | string | no | Name of the merged file. Default: `merged.pdf`. Example: `merged.pdf`. |
| `pdf_urls` | body | array of string | no | Public URLs of the PDFs to merge, in order. Each must be http or https. Provide exactly one of pdf_urls or pdf_base64. Example: `["https://assets.apyhub.com/samples/sample.pdf","https://assets.apyhub… |
| `pdf_base64` | body | array of string | no | Base64-encoded PDFs to merge, in order. The whole request body must be under 5 MB. Provide exactly one of pdf_urls or pdf_base64. Example: `["JVBERi0xLjQKJeLjz9MK...","JVBERi0xLjQKJeLjz9MK..."]`. |
| `response_mode` | body | string | no | How the merged PDF is returned: binary (the file itself), base64, json (base64 plus size and creation time) or url (a temporary download link). One of: binary, base64, json, url. Default: `binary`. E… |

#### Quickstart

Merge a couple of public PDF files and return the result as a temporary download link.

```bash
curl -X POST "https://api.eu.apyhub.com/sarvasoft/merge-pdfs/pdf/merge" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "merged.pdf",
    "pdf_urls": [
      "https://example.com/invoice-1.pdf",
      "https://example.com/invoice-2.pdf"
    ],
    "response_mode": "url"
  }'
```

#### What you'll get back

Returns a JSON object with the merged file and its metadata.

```json
{
  "filename": "merged.pdf",
  "size": 1123,
  "created_at": "2026-01-15T10:30:00Z",
  "pdf_base64": "JVBERi0xLjcKJb/3ov4KMSAwIG9iago8PCAvVHlwZSAvT2JqU3RtIC9MZW5ndGggMjI5..."
}
```

## About

## What it does
The Merge Multiple PDFs API combines several PDFs into one file. Send the PDFs as base64 strings or public URLs in a JSON body, and get back a single merged PDF. Files are joined in the order you list them.

Use `pdf_urls` for an array of public http or https links, or `pdf_base64` for an array of base64-encoded PDFs. Send one of the two lists per request, not both. The whole request body must stay under 5 MB. Set `filename` to name the output, which defaults to `merged.pdf`.

Choose how the merge PDF base64 API returns the result with `response_mode`. `binary` returns the PDF file itself and is the default. `base64` returns the file as a base64 string. `json` adds the file size and creation time. `url` returns a temporary download link with its expiry time.

Teams use it to combine invoices into one monthly statement. They also attach terms to generated contracts and bundle onboarding forms into one packet. As a merge PDF base64 API, it fits backends and serverless functions that never write files to disk.

Before merging, the [Rotate PDF from URL API](https://apyhub.com/sarvasoft/service/rotate-pdf-from-url) can fix sideways pages. After merging, the [Extract PDF Content API](https://apyhub.com/sarvasoft/service/extract-pdf-content) reads the combined text.

AI agents can call it through ApyHub MCP.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/sarvasoft/service/merge-pdfs
