API Documentation

Base URL: https://onlinedoc.pages.dev

Get an API key

  1. Open the Dashboard and sign in with Google.
  2. Under API keys, click Create key and copy it (it starts with od_ and is shown only once).

Send it on every /api/* request:

Authorization: Bearer od_YOUR_KEY

Each key only sees its own owner's documents. Public links (/d/...) need no key.

Using it in n8n (HTTP Request node only)

Nothing needs to be installed in n8n. After the On form submission node, add an HTTP Request node:

FieldValue
MethodPOST
URL/api/upload
Send HeadersON → Authorization = Bearer od_YOUR_KEY
Send BodyON
Body Content TypeForm-Data
Body Parameter 1Type n8n Binary File, Name file, Input Data Field Name = the binary name from your form (e.g. Invoice_Only; check the Binary tab of the form output)
Body Parameter 2 (optional)Type Form Data, Name ttl_days, Value 90

The node's output contains {{ $json.url }}, which is the public link to the PDF.

Simpler alternative: set Body Content Type to n8n Binary File and append ?name=invoice.pdf&ttl_days=90 to the URL.

Endpoints

POST /api/upload

Uploads a PDF. It is optimized (lossless) before being stored.

ParameterDescription
fileThe PDF (multipart). Required. Max 25 MB.
ttl_daysDays to keep the file. Default 90. 0 = never expires. Max 3650.
nameFile name used in the link (optional).
curl -X POST /api/upload \
  -H "Authorization: Bearer od_YOUR_KEY" \
  -F "file=@invoice.pdf" -F "ttl_days=90"
{
  "id": "Mapopi9jAxreOw8RSf9sHg",
  "name": "invoice.pdf",
  "url": "https://onlinedoc.pages.dev/d/USER_ID/Mapopi9jAxreOw8RSf9sHg/invoice.pdf",
  "originalSize": 3587,
  "storedSize": 1833,
  "createdAt": "2026-11-16T13:49:26.429Z",
  "expiresAt": "2027-02-14T13:49:26.429Z",
  "ttlDays": 90,
  "savedBytes": 1754
}

Alternative: send the raw binary directly: POST /api/upload?name=invoice.pdf&ttl_days=90 with the PDF as the body.

GET /api/docs

Lists your documents. Query: limit (max 1000), cursor (from the previous response).

GET /api/docs/:id

Metadata for one document.

PATCH /api/docs/:id

Changes the retention period. The countdown restarts from now.

curl -X PATCH /api/docs/ID \
  -H "Authorization: Bearer od_YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"ttl_days": 30}'

DELETE /api/docs/:id

Deletes the document immediately.

GET /d/:userId/:id/name.pdf (public)

Opens the PDF directly in the browser. Expired documents are deleted automatically and the link returns 404 (or 410 if not yet removed).

GET /api/me

Returns who the key or session belongs to. Handy for testing a key.

Error codes

400Bad parameter / no file
401Missing or invalid API key
404 / 410Not found or expired
413File too large
415Not a PDF