> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dumplingai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge PDFs

> Merge multiple PDFs into a single document.

## Description

This endpoint merges multiple PDF files into a single PDF.

## Endpoint

```
POST /api/v1/merge-pdfs
```

## Headers

* **Content-Type:** `application/json`
* **Authorization:** Bearer `<API_KEY>` (required)

## Request Body

```json theme={null}
{
  "inputMethod": "string", // Required. Either "url" or "base64"
  "files": ["string"], // Required. Array of URLs or base64-encoded PDF contents
  "metadata": {
    // Optional. Metadata for the merged PDF
    "Title": "string",
    "Author": "string",
    "Subject": "string",
    "Keywords": "string"
  },
  "pdfa": "string", // Optional. PDF/A compliance level: "PDF/A-1b", "PDF/A-2b", or "PDF/A-3b"
  "pdfua": "boolean", // Optional. Enable PDF/UA compliance
  "requestSource": "string" // Optional. Source of the request
}
```

## Responses

### Success (200)

Returns the URL of the merged PDF.

```json theme={null}
{
  "url": "string" // URL to the merged PDF file
}
```

## Notes

* Credit usage: 50 credits per 100MB of output PDF size
* Requires at least 2 PDF files to merge
* Optional PDF/A and PDF/UA compliance
* Optional metadata for the merged PDF
* Files are temporarily stored (24-hour retention)

## Rate Limiting

Rate limit headers are included in the response.


## OpenAPI

````yaml POST /api/v1/merge-pdfs
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/merge-pdfs:
    post:
      tags:
        - Documents
      summary: Merge PDFs
      description: Merge multiple PDFs into a single document.
      operationId: mergePdfs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MergePdfsRequest'
            examples:
              default:
                value:
                  inputMethod: url
                  files:
                    - https://example.com/cover.pdf
                    - https://example.com/appendix.pdf
                  metadata:
                    Title: 2025 Strategy Overview
      responses:
        '200':
          description: Merged PDF returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergePdfsResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MergePdfsRequest:
      type: object
      required:
        - inputMethod
        - files
      properties:
        inputMethod:
          $ref: '#/components/schemas/FileInputMethod'
        files:
          type: array
          minItems: 2
          description: Array of PDF URLs or base64-encoded PDF contents to merge.
          items:
            type: string
        metadata:
          type: object
          description: Optional metadata map to embed within the merged PDF.
          additionalProperties: true
        pdfa:
          type: string
          description: Optional PDF/A compliance level to apply when merging.
          enum:
            - PDF/A-1b
            - PDF/A-2b
            - PDF/A-3b
        pdfua:
          type: boolean
          description: Whether to attempt enabling PDF/UA compliance.
        requestSource:
          $ref: '#/components/schemas/RequestSource'
      additionalProperties: false
    MergePdfsResponse:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: Temporary download URL for the merged PDF.
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    FileInputMethod:
      type: string
      description: >-
        Indicates whether binary content is supplied via URL or base64-encoded
        string.
      enum:
        - url
        - base64
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````