{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Toolkit – Merge, Split, Compress, Rotate & Unlock PDFs",
    "description": "Merge PDFs, split by page, ranges, every N pages or bookmarks, extract and reorder pages, rotate, compress (image recompression, size before/after), add or remove a password, strip metadata, get page count and info. URLs or uploads. $3 per 1,000 files + $0.20 per 1,000 pages.",
    "version": "0.1",
    "x-build-id": "Wg0cVTDddHSoXftyZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~pdf-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-pdf-toolkit",
        "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/gazidev~pdf-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-pdf-toolkit",
        "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/gazidev~pdf-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-pdf-toolkit",
        "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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "Operation",
            "enum": [
              "merge",
              "split",
              "extract",
              "rotate",
              "reorder",
              "compress",
              "encrypt",
              "decrypt",
              "remove-metadata",
              "info"
            ],
            "type": "string",
            "description": "Every operation except merge runs on each input PDF separately.",
            "default": "merge"
          },
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files (one per line). For merge this is the page order. Google Drive, Dropbox and GitHub share links are converted to direct downloads. Local/private network addresses are refused.",
            "items": {
              "type": "string"
            }
          },
          "uploadedPdfs": {
            "title": "Or upload PDFs",
            "type": "array",
            "description": "Upload PDFs from your computer. They are processed after the URLs above (merge order: URLs first, then uploads)."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped with a free error. The effective limit is also capped at one third of the run memory (512 MB run = 170 MB files).",
            "default": 100
          },
          "password": {
            "title": "Password of the input PDF(s)",
            "type": "string",
            "description": "Needed to open password-protected inputs (and for \"Remove password\"). Only use this for PDFs you own or are allowed to unlock."
          },
          "userPassword": {
            "title": "New open password (for \"Add password\")",
            "type": "string",
            "description": "Password needed to open the protected PDF. AES-256 encryption."
          },
          "ownerPassword": {
            "title": "New owner password (optional)",
            "type": "string",
            "description": "Password that lifts the permission restrictions below. Defaults to the open password. Set only this (no open password) to make a PDF that opens freely but is restricted."
          },
          "allowPrinting": {
            "title": "Allow printing",
            "type": "boolean",
            "description": "For \"Add password\".",
            "default": true
          },
          "allowCopying": {
            "title": "Allow copying text and images",
            "type": "boolean",
            "description": "For \"Add password\".",
            "default": true
          },
          "allowEditing": {
            "title": "Allow editing (forms, annotations, page assembly)",
            "type": "boolean",
            "description": "For \"Add password\".",
            "default": false
          },
          "pageRange": {
            "title": "Pages (extract / rotate)",
            "type": "string",
            "description": "For extract: the pages to keep, in this order, e.g. `1-3, 5, 10-` (10 to the end), `-1` (last page), `-3--1` (last three), `odd`, `even`. For rotate: pages to rotate (empty = all)."
          },
          "splitMode": {
            "title": "Split mode",
            "enum": [
              "every-page",
              "ranges",
              "every-n",
              "bookmarks"
            ],
            "type": "string",
            "description": "How \"split\" cuts each PDF.",
            "default": "every-page"
          },
          "splitRanges": {
            "title": "Split ranges",
            "type": "string",
            "description": "For split mode \"ranges\": one output per comma-separated part, e.g. `1-3, 4-6, 7-` gives 3 PDFs; `1-3,5` gives pages 1-3 and page 5."
          },
          "splitEveryN": {
            "title": "Pages per part (every N pages)",
            "minimum": 1,
            "type": "integer",
            "description": "For split mode \"every-n\".",
            "default": 2
          },
          "createZip": {
            "title": "Also create a ZIP of the split parts",
            "type": "boolean",
            "description": "One ZIP per split input PDF (free). Its link is in `zipUrl`.",
            "default": false
          },
          "rotation": {
            "title": "Rotation (clockwise)",
            "enum": [
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "For rotate. Added to each page's current rotation.",
            "default": "90"
          },
          "pageOrder": {
            "title": "New page order (reorder)",
            "type": "string",
            "description": "E.g. `3, 1, 2, 4-` or `reverse` or `5-1`. Pages can be repeated; pages left out are dropped (noted in the row)."
          },
          "compressionLevel": {
            "title": "Compression level",
            "enum": [
              "low",
              "medium",
              "high",
              "lossless"
            ],
            "type": "string",
            "description": "Images are re-encoded only when that makes them smaller. Text and vector graphics stay sharp. If the result is not smaller, the original is returned.",
            "default": "medium"
          },
          "imageQuality": {
            "title": "JPEG quality override (10-95)",
            "minimum": 10,
            "maximum": 95,
            "type": "integer",
            "description": "Optional. Overrides the level's JPEG quality."
          },
          "maxImageSize": {
            "title": "Max image side override (px)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Images with a longer side are downscaled. 0 = never downscale."
          },
          "removeMetadataOnCompress": {
            "title": "Also remove metadata when compressing",
            "type": "boolean",
            "description": "Strip author/title/XMP metadata from the compressed PDF too.",
            "default": false
          },
          "outputFileName": {
            "title": "Output file name",
            "type": "string",
            "description": "For merge: name of the merged file (default `merged`). For other operations: prefix instead of the input file name."
          },
          "addBookmarks": {
            "title": "Merge: add a bookmark per input file",
            "type": "boolean",
            "description": "Adds one bookmark (outline entry) per source file, named after the file.",
            "default": true
          },
          "linearize": {
            "title": "Linearize (fast web view)",
            "type": "boolean",
            "description": "Optimise output PDFs for page-by-page loading in browsers.",
            "default": false
          },
          "maxFiles": {
            "title": "Max input files",
            "minimum": 0,
            "type": "integer",
            "description": "0 = no limit.",
            "default": 0
          },
          "maxConcurrency": {
            "title": "Parallel files",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many PDFs are downloaded and processed at the same time.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}