{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Tools: Merge, Split, Rotate, Watermark and Images to PDF",
    "description": "Merge, split, extract, delete, rotate and reorder PDF pages from URLs. Turn JPG and PNG images into a PDF, set or remove metadata, add a text watermark or page numbers, render pages to PNG and read PDF info. Direct file links in the output. Pay per produced file.",
    "version": "0.1",
    "x-build-id": "ijS2jBdTfLSUWflQP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgeloop~pdf-tools/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgeloop-pdf-tools",
        "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/forgeloop~pdf-tools/runs": {
      "post": {
        "operationId": "runs-sync-forgeloop-pdf-tools",
        "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/forgeloop~pdf-tools/run-sync": {
      "post": {
        "operationId": "run-sync-forgeloop-pdf-tools",
        "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": {
          "operation": {
            "title": "Operation",
            "enum": [
              "merge",
              "split",
              "extract",
              "delete",
              "rotate",
              "reorder",
              "imagesToPdf",
              "metadata",
              "watermark",
              "pageNumbers",
              "info",
              "render"
            ],
            "type": "string",
            "description": "What to do with the files under URLs. Merge and images to PDF combine all URLs into one PDF in the given order. All other operations run on each URL separately."
          },
          "urls": {
            "title": "URLs",
            "type": "array",
            "description": "Direct links to PDF files (or JPG and PNG images for images to PDF). http and https only. Links to video or social platforms and private network addresses are refused. Format: a list of strings like [\"https://example.com/report.pdf\"].",
            "items": {
              "type": "string"
            }
          },
          "pages": {
            "title": "Pages",
            "type": "string",
            "description": "Page selection like 1-3,5,8- (8- means page 8 to the end, -3 means pages 1 to 3). Also odd, even, last and all. Split: each comma separated part becomes one file, empty splits every page. Extract: the pages in the given order. Delete: the pages to remove. Reorder: the new order of the first pages, the rest follows in its old order. Rotate, watermark, page numbers and render: the pages to change, empty means all."
          },
          "everyNPages": {
            "title": "Split every N pages",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Split only: one file per N pages, for example 10 gives pages 1-10, 11-20 and so on. Overrides Pages."
          },
          "angle": {
            "title": "Rotation",
            "enum": [
              "90",
              "180",
              "270"
            ],
            "type": "string",
            "description": "Rotate only: degrees clockwise, added to the current rotation of each page."
          },
          "pageSize": {
            "title": "Page size (images to PDF)",
            "enum": [
              "A4",
              "Letter",
              "Legal",
              "A3",
              "A5",
              "fit"
            ],
            "type": "string",
            "description": "Images to PDF only: paper size of each page. Fit makes each page exactly as large as its image (1 pixel = 0.75 pt, like 96 dpi). Default A4."
          },
          "orientation": {
            "title": "Orientation (images to PDF)",
            "enum": [
              "auto",
              "portrait",
              "landscape"
            ],
            "type": "string",
            "description": "Images to PDF only: auto turns the page to landscape for wide images. Default auto."
          },
          "marginMm": {
            "title": "Margin (mm)",
            "minimum": 0,
            "maximum": 50,
            "type": "number",
            "description": "Images to PDF: white margin around each image, default 10 (0 for fit). Page numbers: distance from the page edge, default 10. 0 to 50."
          },
          "title": {
            "title": "Title",
            "type": "string",
            "description": "Metadata only: new document title."
          },
          "author": {
            "title": "Author",
            "type": "string",
            "description": "Metadata only: new author, usually your organisation."
          },
          "subject": {
            "title": "Subject",
            "type": "string",
            "description": "Metadata only: new subject."
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Metadata only: keywords separated by commas, like invoice, 2026, client."
          },
          "removeMetadata": {
            "title": "Remove existing metadata",
            "type": "boolean",
            "description": "Metadata only: delete all existing document information (title, author, creator, producer, dates, custom fields) and the XMP metadata first. Fields above are then set on the clean file."
          },
          "watermarkText": {
            "title": "Watermark text",
            "type": "string",
            "description": "Watermark only: text drawn across the middle of each selected page, like DRAFT or CONFIDENTIAL. Latin characters only (built-in Helvetica font). Long texts shrink to fit the page."
          },
          "watermarkAngle": {
            "title": "Watermark angle",
            "minimum": -180,
            "maximum": 180,
            "type": "integer",
            "description": "Watermark only: angle of the text in degrees, counterclockwise. 0 is horizontal. Default 45."
          },
          "fontSize": {
            "title": "Font size (pt)",
            "minimum": 4,
            "maximum": 300,
            "type": "number",
            "description": "Watermark: default 60. Page numbers: default 10."
          },
          "opacity": {
            "title": "Watermark opacity",
            "minimum": 0.05,
            "maximum": 1,
            "type": "number",
            "description": "Watermark only: 0.05 (almost invisible) to 1 (solid). Default 0.25."
          },
          "color": {
            "title": "Text color",
            "type": "string",
            "description": "Hex color like #FF0000. Watermark default #808080 (gray), page numbers default #333333."
          },
          "pageNumberFormat": {
            "title": "Page number format",
            "type": "string",
            "description": "Page numbers only: text with {n} for the number and {total} for the last number, like Page {n} of {total}. Default {n} / {total}."
          },
          "pageNumberPosition": {
            "title": "Page number position",
            "enum": [
              "bottom-center",
              "bottom-right",
              "bottom-left",
              "top-center",
              "top-right",
              "top-left"
            ],
            "type": "string",
            "description": "Page numbers only: where the number goes on each page, as the page is displayed. Default bottom center."
          },
          "startNumber": {
            "title": "First page number",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Page numbers only: number of the first numbered page. With Pages set to 2- the cover stays unnumbered and page 2 shows this number. Default 1."
          },
          "dpi": {
            "title": "Render resolution (DPI)",
            "minimum": 36,
            "maximum": 300,
            "type": "integer",
            "description": "Render only: resolution of the PNG files. 72 is screen size, 150 is good for reading, 300 for print. 36 to 300, default 110. At most 100 pages per file."
          },
          "outputName": {
            "title": "Output file name",
            "type": "string",
            "description": "Base name for the output files. Empty uses the source file name. Keys look like 01-split-report-p1-3.pdf (job number, operation, name, pages)."
          },
          "jobs": {
            "title": "Jobs (several operations in one run)",
            "type": "array",
            "description": "Optional, replaces Operation and URLs. A JSON array of jobs, each with operation, urls and options, for example [{\"operation\": \"merge\", \"urls\": [\"https://a.com/1.pdf\", \"https://a.com/2.pdf\"]}, {\"operation\": \"watermark\", \"urls\": [\"https://a.com/3.pdf\"], \"options\": {\"watermarkText\": \"DRAFT\", \"pages\": \"1\"}}]. Option names are the same as the fields of this form. Fields filled in the form act as defaults for every job."
          },
          "maxFileSizeMb": {
            "title": "Max file size (MB)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Larger downloads are stopped and get a free error row. 1 to 100.",
            "default": 100
          },
          "timeoutSecs": {
            "title": "Download timeout (seconds)",
            "minimum": 10,
            "maximum": 600,
            "type": "integer",
            "description": "Give up on a download after this many seconds. 10 to 600.",
            "default": 120
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}