apyhub
FILE MANIPULATION

Apply Watermark on PDF API

Hosted on ApyHub

What it does

PDF Watermarking adds a text or image watermark to each page of a PDF. Send a PDF file or a public PDF URL, choose watermark_text or watermark_image/watermark_image_url, and get back the watermarked document.

Use the file-based endpoints when your PDF is already in your app, or the URL-based endpoints when the source document is hosted elsewhere. The service supports both direct download responses and S3-style URL outputs, so you can either stream the result to a user or store it for later processing. The output field is available on the /file/download route if you want to set the returned filename stem.

This is useful for marking drafts, branding exported reports, or protecting shared documents before sending them to customers or internal teams. Keep the watermark consistent across pages without building PDF rendering logic yourself.

If you need to process documents from uploads or remote links, PDF Watermarking keeps the request simple and the output predictable.

▣ ENDPOINT 01 / 04
POST
Add watermark to PDF (file upload → download)
http://localhost:8080/apyhub/apply-watermark-on-pdf/file/download
QUICKSTARTGUIDE

Quickstart

Upload a PDF and a watermark file to generate a watermarked PDF download.

curl -X POST "http://localhost:8080/apyhub/apply-watermark-on-pdf/file/download" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/file.pdf" \
  -F "watermark_image=@/path/to/watermark.png"

What you'll get back

Returns a binary file (string with format: binary) containing the generated PDF.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
PDF file to watermark.
Output filename stem (without extension). Defaults to `output`.
Watermark text rendered on every page. At least one of watermark_text or watermark_image is required.
PNG image scaled to fit each page as a watermark.

About this endpoint

What it does

Uploads a PDF file, applies a watermark to it, and returns the watermarked PDF as a downloadable binary file.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file to watermark.
outputStringNoOutput filename stem without extension. Defaults to output.
watermark_textStringNoWatermark text rendered on every page. At least one of watermark_text or watermark_image is required.
watermark_imageStringNoPNG image scaled to fit each page as a watermark.

Response

Returns a binary file containing the watermarked PDF. The output schema is a single binary string, so the success response is a downloadable file rather than a JSON object.

AttributeTypeMandatoryDescription
binary responseStringYesWatermarked PDF file content returned as binary data.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
POST
Add watermark to PDF (file upload → S3 URL)
http://localhost:8080/apyhub/apply-watermark-on-pdf/file/url
QUICKSTARTGUIDE

Quickstart

Upload a PDF file to generate a watermarked PDF link.

curl -X POST "http://localhost:8080/apyhub/apply-watermark-on-pdf/file/url" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"

What you'll get back

Returns a JSON object with a url string field containing the watermarked PDF file URL.

{
  "url": "https://s3.amazonaws.com/bucket/watermarked.pdf"
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Uploads a PDF file and returns a URL for the watermarked PDF output. The request can include either watermark text or a watermark image, and the response provides the generated file location as a URL.

Request Body

ParameterTypeMandatoryDescription
fileStringYesPDF file to watermark. Binary upload.
watermark_textStringNoText to apply as the watermark.
watermark_imageStringNoImage file to apply as the watermark. Binary upload.

Response

Returns a JSON object with a url string field containing the URI of the watermarked PDF output.

ParameterTypeMandatoryDescription
urlStringNoURI of the generated watermarked PDF.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 04
POST
Add watermark to PDF (URL → download)
http://localhost:8080/apyhub/apply-watermark-on-pdf/url/download
QUICKSTARTGUIDE

Quickstart

Download a PDF from a public URL and apply a text watermark in one call.

curl -X POST "http://localhost:8080/apyhub/apply-watermark-on-pdf/url/download" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://assets.apyhub.com/samples/sample.pdf",
    "watermark_text": "DRAFT"
  }'

What you'll get back

Returns the generated PDF as a binary file.

TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Publicly accessible PDF URL.
At least one of watermark_text or watermark_image_url is required.
Publicly accessible PNG image URL to use as the watermark.

About this endpoint

What it does

Takes a publicly accessible PDF URL and applies a watermark to it, then returns the generated PDF as a binary response. The request must include file_url, and you can provide either watermark text or a watermark image URL.

Request Body

ParameterTypeMandatoryDescription
file_urlStringYesPublicly accessible PDF URL. Must be a URI.
watermark_textStringNoWatermark text. At least one of watermark_text or watermark_image_url is required.
watermark_image_urlStringNoPublicly accessible PNG image URL to use as the watermark. Must be a URI.

Response

Returns a binary file response containing the watermarked PDF.

ParameterTypeMandatoryDescription
binaryStringYesThe generated PDF content returned as binary data.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 04 / 04
POST
Add watermark to PDF (URL → S3 URL)
http://localhost:8080/apyhub/apply-watermark-on-pdf/url/url
QUICKSTARTGUIDE

Quickstart

Create a watermarked PDF from a public file URL.

curl -X POST "http://localhost:8080/apyhub/apply-watermark-on-pdf/url/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "file_url": "https://assets.apyhub.com/samples/sample.pdf",
    "watermark_text": "DRAFT"
  }'

What you'll get back

Returns a JSON object with a url string field — the location of the generated watermarked PDF.

{
  "url": "https://s3.amazonaws.com/bucket/watermarked.pdf"
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Adds a watermark to a PDF fetched from a URL and returns the URL of the generated watermarked file. The request body accepts the source PDF URL plus either watermark text or a watermark image URL.

Request Body

ParameterTypeMandatoryDescription
file_urlStringYesURL of the PDF file to watermark. Must be a URI.
watermark_textStringNoText to use as the watermark.
watermark_image_urlStringNoURL of the image to use as the watermark. Must be a URI.

Response

Returns a JSON object with a url string field containing the URL of the generated watermarked PDF.

ParameterTypeMandatoryDescription
urlStringNoURL of the watermarked PDF. Must be a URI.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.