---
title: "Add a text or image watermark to a PDF"
method: POST
path: "/pdf-watermark"
tags: ["PDF"]
---

# Add a text or image watermark to a PDF

`POST /pdf-watermark`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/pdf-watermark`
- Auth: API key in header `x-api-key`

Overlays a text (max 200 characters) OR a PNG/JPEG image on every page (or on `pages`). Image watermarks need the JSON body.

Costs 1 credit per call.

## Request body

- object
  - `file` string, byte, required: The PDF, base64-encoded.
  - `text` string: Watermark text. Provide text or image, not both.
  - `image` string, byte: Watermark image (PNG or JPEG), base64.
  - `opacity` number: Watermark opacity from 0.05 (almost invisible) to 1 (solid). Default 0.3.
  - `rotation` number: Rotation of the watermark in degrees (-360 to 360). Default 45 (diagonal).
  - `position` 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right': Where the watermark goes: "center" (default), "top-left", "top-right", "bottom-left" or "bottom-right".
  - `font_size` number: Text only.
  - `color` string: Text only.
  - `scale` number: Image only: width as a fraction of the page width.
  - `pages` string: Pages to act on, 1-indexed, e.g. "1-3,5,7-9". Default: all pages.
  - `output` 'json' | 'binary' | 'url' | 'pdf': How to return the PDF: "json" (base64 in the JSON response), "binary" (the PDF itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

## Response `200`

The resulting PDF (shape depends on `output`).

- union
  - object
    - `success` boolean
    - `pdf` string, byte
    - `mime_type` 'application/pdf'
    - `meta` object
      - `size_bytes` integer
      - `used` integer: Credits used this month, after this call.
      - `remaining` integer, nullable: Credits left this month (null = unlimited).
      - `unlimited` boolean
  - object: Returned when output=url: a temporary download link (valid 15 minutes).
    - `success` boolean
    - `url` string, uri: Temporary download link. Expires in 15 minutes.
    - `expires_at` string, date-time
    - `mime_type` string
    - `size_bytes` integer
    - `meta` object
      - `used` integer: Credits used this month, after this call.
      - `remaining` integer, nullable: Credits left this month (null = unlimited).
      - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

[API](https://skmtc.dev/cofferdock/apis/cofferdock-api.md) · [All operations](https://skmtc.dev/cofferdock/apis/cofferdock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cofferdock/apis/cofferdock-api/revisions/b57aa000d33a?raw)
