{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Toolkit: Merge, Split, Compress, Images to PDF & Back",
    "description": "Merge, split, compress, rotate, watermark and number PDF pages, turn images into PDFs and PDF pages into PNG/JPG, edit metadata, remove known passwords. Chain steps in one run. $1 per 1,000 files + $0.30 per 1,000 pages.",
    "version": "0.1",
    "x-build-id": "LVUKoKqkBPebUEexm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plotpointtech~pdf-toolkit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plotpointtech-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/plotpointtech~pdf-toolkit/runs": {
      "post": {
        "operationId": "runs-sync-plotpointtech-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/plotpointtech~pdf-toolkit/run-sync": {
      "post": {
        "operationId": "run-sync-plotpointtech-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",
        "properties": {
          "files": {
            "title": "PDF and image URLs",
            "type": "array",
            "description": "Direct links to PDF files or images (JPEG, PNG, WebP, GIF, BMP, TIFF, HEIC). They are processed in this order (merge keeps it).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "uploadedFile": {
            "title": "Or upload a file",
            "type": "string",
            "description": "Upload a PDF or image from your computer."
          },
          "uploadedFile2": {
            "title": "Upload a second file",
            "type": "string",
            "description": "Optional second upload, for example to merge two files."
          },
          "operations": {
            "title": "Operations (in order)",
            "type": "array",
            "description": "Steps applied to the files in the order listed. Example: merge then compress.",
            "items": {
              "type": "string",
              "enum": [
                "merge",
                "split",
                "extract",
                "compress",
                "rotate",
                "watermark",
                "pageNumbers",
                "imagesToPdf",
                "pdfToImages",
                "metadata",
                "removePassword"
              ],
              "enumTitles": [
                "Merge into one PDF",
                "Split into parts",
                "Extract pages",
                "Compress",
                "Rotate pages",
                "Add text watermark",
                "Add page numbers",
                "Images to PDF",
                "PDF pages to images (last step)",
                "Read or edit metadata",
                "Remove password (you supply it)"
              ]
            }
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Pages for extract, rotate, watermark, page numbers and PDF to images: for example 1-3,5,8-end or last. Empty means all pages."
          },
          "splitEveryNPages": {
            "title": "Split every N pages",
            "minimum": 0,
            "type": "integer",
            "description": "Split into parts of this many pages. 1 makes one PDF per page. Ignored if Split ranges is set."
          },
          "splitRanges": {
            "title": "Split ranges",
            "type": "string",
            "description": "One part per range, separated by semicolons, for example 1-2; 3-5; 6-end."
          },
          "compressionPreset": {
            "title": "Compression level",
            "enum": [
              "screen",
              "ebook",
              "printer",
              "lossless"
            ],
            "type": "string",
            "description": "How far images inside the PDF are downsampled. Lossless never changes image quality.",
            "default": "ebook"
          },
          "rotateDegrees": {
            "title": "Rotate by (degrees)",
            "type": "integer",
            "description": "90, 180 or 270 (negative turns the other way).",
            "default": 90
          },
          "watermarkText": {
            "title": "Watermark text",
            "type": "string",
            "description": "Text stamped across each selected page.",
            "default": "CONFIDENTIAL"
          },
          "watermarkOpacity": {
            "title": "Watermark opacity",
            "minimum": 0.02,
            "maximum": 1,
            "type": "number",
            "description": "0.02 (faint) to 1 (solid).",
            "default": 0.2
          },
          "watermarkFontSize": {
            "title": "Watermark font size",
            "minimum": 0,
            "type": "number",
            "description": "0 sizes the text to fit the page.",
            "default": 0
          },
          "watermarkAngle": {
            "title": "Watermark angle",
            "type": "number",
            "description": "Degrees, 45 runs bottom-left to top-right.",
            "default": 45
          },
          "watermarkColor": {
            "title": "Watermark colour",
            "type": "string",
            "description": "Hex colour, for example #808080.",
            "default": "#808080"
          },
          "pageNumberFormat": {
            "title": "Page number format",
            "type": "string",
            "description": "Use {n} for the page number and {total} for the page count.",
            "default": "Page {n} of {total}"
          },
          "pageNumberPosition": {
            "title": "Page number position",
            "enum": [
              "bottom-center",
              "bottom-right",
              "bottom-left",
              "top-center",
              "top-right",
              "top-left"
            ],
            "type": "string",
            "description": "Where the number is placed.",
            "default": "bottom-center"
          },
          "pageNumberFontSize": {
            "title": "Page number font size",
            "minimum": 5,
            "maximum": 72,
            "type": "number",
            "description": "Font size in points.",
            "default": 10
          },
          "pageNumberStart": {
            "title": "First page number",
            "minimum": 0,
            "type": "integer",
            "description": "Number shown on the first selected page.",
            "default": 1
          },
          "pageNumberMargin": {
            "title": "Page number margin (pt)",
            "minimum": 0,
            "type": "number",
            "description": "Distance from the page edge in points (72 pt = 1 inch).",
            "default": 24
          },
          "pageNumberColor": {
            "title": "Page number colour",
            "type": "string",
            "description": "Hex colour.",
            "default": "#000000"
          },
          "imagesToPdfMode": {
            "title": "Images to PDF",
            "enum": [
              "single",
              "perImage"
            ],
            "type": "string",
            "description": "Combine all images into one PDF or make one PDF each.",
            "default": "single"
          },
          "imagePageSize": {
            "title": "Image page size",
            "enum": [
              "original",
              "a4",
              "letter",
              "legal",
              "a3",
              "a5"
            ],
            "type": "string",
            "description": "Original keeps each image's own size; the others fit the image on that paper size.",
            "default": "original"
          },
          "imageMarginMm": {
            "title": "Image margin (mm)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "White margin around each image when a paper size is used.",
            "default": 0
          },
          "imageFormat": {
            "title": "Image format (PDF to images)",
            "enum": [
              "png",
              "jpg"
            ],
            "type": "string",
            "description": "PNG is sharp for text; JPG is smaller for photos.",
            "default": "png"
          },
          "dpi": {
            "title": "Image resolution (DPI)",
            "minimum": 36,
            "maximum": 600,
            "type": "integer",
            "description": "150 is good on screen, 300 for print or OCR.",
            "default": 150
          },
          "jpgQuality": {
            "title": "JPG quality",
            "minimum": 10,
            "maximum": 100,
            "type": "integer",
            "description": "For JPG output.",
            "default": 85
          },
          "metaTitle": {
            "title": "Set title",
            "type": "string",
            "description": "New document title (metadata step). An empty value removes it."
          },
          "metaAuthor": {
            "title": "Set author",
            "type": "string",
            "description": "New document author (metadata step). An empty value removes it."
          },
          "metaSubject": {
            "title": "Set subject",
            "type": "string",
            "description": "New document subject (metadata step). An empty value removes it."
          },
          "metaKeywords": {
            "title": "Set keywords",
            "type": "string",
            "description": "New document keywords (metadata step). An empty value removes it."
          },
          "metaCreator": {
            "title": "Set creator",
            "type": "string",
            "description": "New document creator (metadata step). An empty value removes it."
          },
          "metaProducer": {
            "title": "Set producer",
            "type": "string",
            "description": "New document producer (metadata step). An empty value removes it."
          },
          "clearMetadata": {
            "title": "Clear all metadata",
            "type": "boolean",
            "description": "Remove all document information and XMP metadata (metadata step).",
            "default": false
          },
          "password": {
            "title": "PDF password",
            "type": "string",
            "description": "The password of your protected PDF, needed to open it or to remove its protection. We never guess or crack passwords."
          },
          "outputFileName": {
            "title": "Merged file name",
            "type": "string",
            "description": "Name of the merged PDF.",
            "default": "merged.pdf"
          },
          "addBookmarks": {
            "title": "Bookmark each merged file",
            "type": "boolean",
            "description": "Add a bookmark at the start of each file in a merged PDF.",
            "default": true
          },
          "linearize": {
            "title": "Fast web view",
            "type": "boolean",
            "description": "Linearise output PDFs so browsers show the first page while downloading.",
            "default": false
          },
          "createZip": {
            "title": "Also create a ZIP",
            "type": "boolean",
            "description": "One ZIP with all output files, handy for split and PDF to images.",
            "default": false
          },
          "maxFileSizeMb": {
            "title": "Maximum file size (MB)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Larger files are skipped and not charged.",
            "default": 100
          },
          "maxTotalPages": {
            "title": "Maximum total pages",
            "minimum": 1,
            "type": "integer",
            "description": "Stop loading files once this many pages are reached.",
            "default": 2000
          },
          "maxConcurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many files to download at once.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}