{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Merger & Splitter: Merge, Split, Extract Pages",
    "description": "PDF merger and PDF splitter for URLs: merge PDF files in order, split PDF every N pages or by ranges, extract pages from PDF, rotate and reverse pages. Password-protected PDFs supported. Every result gets a direct download link, page count and size.",
    "version": "0.1",
    "x-build-id": "hf6LhsA0dhbGLtQfw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~pdf-merger-splitter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-pdf-merger-splitter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/data-done-right~pdf-merger-splitter/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-pdf-merger-splitter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/data-done-right~pdf-merger-splitter/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-pdf-merger-splitter",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "urls"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "merge",
              "split",
              "extract",
              "rotate",
              "reverse"
            ],
            "type": "string",
            "description": "What to do. merge = join all files into one PDF (in the order given). split = cut each file into several PDFs (see Split mode). extract = keep only the pages in 'Page ranges' as one new PDF per file. rotate = turn pages by 90/180/270 degrees. reverse = reverse the page order.",
            "default": "merge"
          },
          "urls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, in the order they should be merged. Example: https://example.com/a.pdf. For merge, add a page range per file in 'Page range per file'. Each item may also be an object like {\"url\": \"https://example.com/a.pdf\", \"pages\": \"1-3,5\", \"password\": \"...\"} when you call the Actor by API.",
            "items": {
              "type": "string"
            }
          },
          "filePageRanges": {
            "title": "Page range per file (merge)",
            "type": "array",
            "description": "Optional. For merge: which pages to take from each file, in the same order as the URLs. One entry per file; leave an entry empty for all pages. Example: 1-3,5 takes pages 1, 2, 3 and 5; 4- takes page 4 to the end; 5-1 takes pages 5 down to 1.",
            "items": {
              "type": "string"
            }
          },
          "pageRanges": {
            "title": "Page ranges",
            "type": "string",
            "description": "Used by extract, rotate, reverse and split (by ranges). Example: 1-3,5 (pages 1 to 3 and page 5), 4- (page 4 to the end), last, 5-1 (pages 5 down to 1). Extract keeps the order you write, so 5,1-3 also reorders pages. Rotate: leave empty to rotate every page. Split by ranges: each comma-separated range becomes its own PDF (1-3,4-6,7- makes three files; join pages with +, e.g. 1+9)."
          },
          "splitMode": {
            "title": "Split mode",
            "enum": [
              "everyN",
              "ranges",
              "eachPage"
            ],
            "type": "string",
            "description": "How 'split' cuts each file: every N pages, by page ranges, or one PDF per page.",
            "default": "everyN"
          },
          "splitEvery": {
            "title": "Split every N pages",
            "minimum": 1,
            "type": "integer",
            "description": "For split mode 'Every N pages': pages per output file. Example: 10 turns a 45-page PDF into 5 files (the last has 5 pages).",
            "default": 10
          },
          "rotateAngle": {
            "title": "Rotate by (degrees)",
            "enum": [
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "For the rotate operation: clockwise angle added to the selected pages.",
            "default": "90"
          },
          "outputFileName": {
            "title": "Merged file name",
            "type": "string",
            "description": "File name of the merged PDF. Example: contract-bundle.pdf",
            "default": "merged.pdf"
          },
          "skipBadFiles": {
            "title": "Skip unreadable files when merging",
            "type": "boolean",
            "description": "Off (default): if any input cannot be downloaded or opened, nothing is merged and the row says which file failed, so you never get a silently incomplete PDF. On: merge the readable files and list the skipped ones in 'warnings'.",
            "default": false
          },
          "password": {
            "title": "Password for protected PDFs",
            "type": "string",
            "description": "Opens password-protected PDFs (the same password is tried on every file; you can also set a password per file with the object form of the URL list). Wrong or missing passwords give a clear error for that file. Passwords are never cracked or guessed. Results are saved without encryption."
          },
          "keyValueStoreId": {
            "title": "Input key-value store (ID or name)",
            "type": "string",
            "description": "Optional. Read PDF records from one of your Apify key-value stores (for example the output of another Actor). Used together with 'Record keys'."
          },
          "recordKeys": {
            "title": "Record keys",
            "type": "array",
            "description": "Optional. Keys of PDF records in the input key-value store, added after the URLs. Example: invoice-001.pdf",
            "items": {
              "type": "string"
            }
          },
          "maxOutputFiles": {
            "title": "Max output PDFs",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many result PDFs. Also caps the cost (one charge per result file).",
            "default": 100
          },
          "maxFileSizeMb": {
            "title": "Max size per input PDF (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Input files larger than this are not downloaded (reported as failed).",
            "default": 50
          },
          "maxPagesPerFile": {
            "title": "Max pages per input PDF",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Input PDFs with more pages are rejected.",
            "default": 1000
          },
          "keyValueStoreName": {
            "title": "Save results to named key-value store",
            "type": "string",
            "description": "Optional. Keep the result PDFs in this named store (kept until you delete it) instead of the run's default store (deleted after your plan's data retention period)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Only needed if the PDF host blocks datacenter IPs.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}