{
  "openapi": "3.0.1",
  "info": {
    "title": "PDF Watermark & Page Number Tool",
    "description": "Add a text watermark or page numbers to PDFs from links or an upload; returns a link to each stamped PDF. Use when you need DRAFT or CONFIDENTIAL marks on PDFs.",
    "version": "0.0",
    "x-build-id": "zb6erKyfuWdxWj0Xu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plainpipe~pdf-watermark/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plainpipe-pdf-watermark",
        "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/plainpipe~pdf-watermark/runs": {
      "post": {
        "operationId": "runs-sync-plainpipe-pdf-watermark",
        "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/plainpipe~pdf-watermark/run-sync": {
      "post": {
        "operationId": "run-sync-plainpipe-pdf-watermark",
        "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": {
          "pdfUrls": {
            "title": "PDF URLs",
            "type": "array",
            "description": "Direct links to PDF files, one per line. Each file gives one stamped PDF. Example: https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf. The link must return the .pdf file itself, not a viewer page.",
            "items": {
              "type": "string"
            }
          },
          "pdfFile": {
            "title": "Upload a PDF (optional)",
            "type": "string",
            "description": "Or upload one PDF file from your computer, for example contract.pdf. It is processed after the URLs above. Up to 50 MB. Leave empty when you only use PDF URLs."
          },
          "text": {
            "title": "Watermark text",
            "type": "string",
            "description": "Text to draw on the pages, for example DRAFT or CONFIDENTIAL. Leave empty to add only page numbers. Latin letters, digits and common punctuation only, up to 200 characters."
          },
          "position": {
            "title": "Watermark position",
            "enum": [
              "diagonal",
              "center",
              "top",
              "bottom",
              "corner"
            ],
            "type": "string",
            "description": "diagonal = across the page from bottom-left to top-right (ignores Rotation). center = middle of the page. top / bottom = centered near the top or bottom edge. corner = bottom-right corner.",
            "default": "diagonal"
          },
          "fontSize": {
            "title": "Font size (pt)",
            "minimum": 4,
            "maximum": 400,
            "type": "integer",
            "description": "Size of the watermark text in points, 4-400. Default 48. Example: 72 for a large diagonal DRAFT.",
            "default": 48
          },
          "opacity": {
            "title": "Opacity",
            "type": "string",
            "description": "How solid the watermark is, a decimal number written as text from 0 (invisible) to 1 (fully solid). Default 0.3. Example: 0.15 for a faint mark.",
            "default": "0.3"
          },
          "rotation": {
            "title": "Rotation (degrees)",
            "minimum": -360,
            "maximum": 360,
            "type": "integer",
            "description": "Turn the watermark counter-clockwise by this many degrees, -360 to 360. Default 0. Example: 90 for vertical text. Not used with the diagonal position.",
            "default": 0
          },
          "color": {
            "title": "Color (hex)",
            "type": "string",
            "description": "Text color as a hex code, for example #808080 (gray) or #c00 (red). Also used for page numbers.",
            "default": "#808080"
          },
          "pages": {
            "title": "Pages to stamp",
            "type": "string",
            "description": "all, or page numbers and ranges such as 1-3,5. Default all. Pages start at 1. A range past the last page of a file fails the run, with no charge.",
            "default": "all"
          },
          "pageNumbers": {
            "title": "Add page numbers",
            "type": "boolean",
            "description": "Also print a page number on each stamped page, using the format below. Default off.",
            "default": false
          },
          "pageNumberFormat": {
            "title": "Page number format",
            "type": "string",
            "description": "Text of the page number. {n} is the page number and {total} the number of pages in the file. Default: Page {n} of {total}. Example: {n} / {total}.",
            "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 page number goes on the page. Default bottom-center.",
            "default": "bottom-center"
          },
          "pageNumberFontSize": {
            "title": "Page number font size (pt)",
            "minimum": 4,
            "maximum": 100,
            "type": "integer",
            "description": "Size of the page number text in points, 4-100. Default 10.",
            "default": 10
          },
          "outputName": {
            "title": "Output file name (optional)",
            "type": "string",
            "description": "Base name for the output files in the key-value store, without .pdf. Empty = source file name plus -watermarked, for example dummy-watermarked.pdf. With several files a number is added to keep names unique, for example stamped-2.pdf."
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many output PDF files. You are charged per output file. Default 100. Example: 10.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}