---
title: "Merge multiple PDF files into a single document"
method: POST
path: "/files/merge"
tags: ["files"]
---

# Merge multiple PDF files into a single document

`POST /files/merge`

## Request

- Base URL: `https://docs-api.formify.eu/v1`
- URL: `https://docs-api.formify.eu/v1/files/merge`
- Auth: OAuth 2 (authorization code, authorization URL `https://docs-api.formify.eu/v1/oauth/authorize`, token URL `https://docs-api.formify.eu/v1/oauth/token`)

Merges two or more uploaded PDF files into a single file. The resulting file will be assigned a new `fileId`.

### Requirements
- **File Format**: Only pre-uploaded PDF files are supported for merging.
- **Order of Merge**: The files will be merged in the order of the provided `fileIds`.
- **File Name**: A name for the resulting merged file must be provided.
- **Max File Size**: Ensure the combined file size does not exceed system limits (**50 MB**).
- **2-8 Files**: A minimum of 2 files and a maximum of 8 `fileIds` are required (duplicate `fileIds` are not allowed.).

This endpoint is particularly useful for workflows where multiple PDF files need to be combined before sending them for signatures or further processing.

## Request body

- object
  - `fileIds` string[]: List of File IDs to merge. Must contain between 2 and 8 unique File IDs.
  - `name` string: Name for the resulting merged file.

## Response `201`

Files merged successfully.

- object
  - `fileId` string, uuid: The unique identifier of the merged file.

## Other responses

- `400`: Invalid request parameters or issues with the files.
- `401`: Unauthorized - Missing or invalid access token.
- `403`: Forbidden - Access to one or more files is denied.
- `500`: Internal server error.

---

[API](https://skmtc.dev/formify/apis/formify-api.md) · [All operations](https://skmtc.dev/formify/apis/formify-api/llms.txt) · [OpenAPI document](https://skmtc.dev/formify/apis/formify-api/revisions/571c4c0d4f4f?raw)
