---
updatedAt: 2026-04-24T18:36:38.000Z
agentTools:
  projectIndex: https://docs.docupipe.ai/llms.txt
---

# Merge Documents

Merge multiple documents into a single PDF document.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "DocuPipe",
    "version": "1.0"
  },
  "paths": {
    "/documents/merge": {
      "post": {
        "tags": [
          "Document"
        ],
        "summary": "Merge Documents",
        "description": "Merge multiple documents into a single PDF document.",
        "operationId": "post_merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeJobRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostMergeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientCreditsError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "Details about the error"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "ErrorResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "InsufficientCreditsError": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail",
            "description": "Explanation about the exhausted credits"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "InsufficientCreditsError"
      },
      "MergeJobRequest": {
        "properties": {
          "documentIds": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Document IDs",
            "description": "List of unique identifiers of the documents to be merged. The order of IDs determines the order of documents in the merged output. Must contain at least two document IDs."
          },
          "filename": {
            "type": "string",
            "title": "Filename",
            "description": "Filename of the newly generated document after merging."
          },
          "dataset": {
            "type": "string",
            "title": "Dataset",
            "description": "Dataset to assign to the newly generated document."
          }
        },
        "type": "object",
        "required": [
          "documentIds",
          "filename"
        ],
        "title": "MergeJobRequest"
      },
      "PostMergeResponse": {
        "properties": {
          "jobId": {
            "type": "string",
            "title": "Job ID",
            "description": "Unique identifier for the submitted job."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp",
            "description": "Timestamp of when the job was submitted."
          },
          "success": {
            "type": "boolean",
            "title": "Success",
            "description": "Whether the job was successfully submitted.",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "jobId"
        ],
        "title": "PostMergeResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      },
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://app.docupipe.ai"
    }
  ]
}
```