PapermarkDocs

Create a link or Notion document

Add a document that points at an external URL or a public Notion page — no file upload — and repoint it later without re-sharing.

Not every document is a file. A link document points at any external HTTPS page; a notion document points at a publicly-accessible Notion page. Both store the URL itself rather than uploaded bytes, so they sit alongside your PDFs and decks in the team library and in datarooms, and share links work the same way.

Reads return the target in a url field (it's null for file-based documents), and you repoint a link/notion document by adding a new version — existing share links instantly serve the new target, with the old URL kept in history.

# A link document pointing at an external page
papermark documents create-link https://example.com/pricing --name "Pricing page"
# → Document created: doc_abc123

# A Notion document (the page must be publicly accessible)
papermark documents create-notion \
  https://www.notion.so/acme/Handbook-abc123 --name "Handbook"

Both accept --folder-id <id> to place the document in a team-library folder and --link to also create a default share link.

Read it back — the target shows up in url:

papermark documents get doc_abc123 --json | jq '{type, url}'
# → { "type": "link", "url": "https://example.com/pricing" }

Repoint it at a new URL (records a new primary version, type preserved):

papermark documents versions add-link doc_abc123 https://example.com/pricing-2025
papermark documents versions add-notion doc_def456 https://www.notion.so/acme/Handbook-v2

Creating a link/notion document is a single call — no presign/PUT dance, since nothing is uploaded. Pass type and external_url instead of upload_id / source_url.

TOKEN=pm_live_…

# Link document
curl -X POST https://api.papermark.com/v1/documents \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Pricing page","type":"link","external_url":"https://example.com/pricing"}'

# Notion document (page must be public)
curl -X POST https://api.papermark.com/v1/documents \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Handbook","type":"notion","external_url":"https://www.notion.so/acme/Handbook-abc123"}'

external_url must be HTTPS. It's only valid with type: link or type: notion; for file documents keep using upload_id / source_url.

The document response (and GET /v1/documents/{id}, list, search, and the dataroom documents listing) includes the target in url:

{ "id": "doc_abc123", "object": "document", "type": "link",
  "url": "https://example.com/pricing", "content_type": null, "num_pages": 1 }

Repoint it by adding a new version with external_url — the type is inherited from the document, so there's no type field here:

curl -X POST "https://api.papermark.com/v1/documents/doc_abc123/versions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"external_url":"https://example.com/pricing-2025"}'

The new version becomes primary in the same transaction; roll back with PATCH /v1/documents/{id}/versions/{version_id} and {"is_primary":true}.

Required scope: documents.write (reads: documents.read).

Add a document to Papermark that points at https://example.com/pricing, call it "Pricing page".

The agent calls upload_document with type: "link" and external_url: "https://example.com/pricing". For a Notion page, name the Notion URL and it uses type: "notion" instead (the page must be public).

The pricing page moved to https://example.com/pricing-2025 — update the "Pricing page" document.

The agent finds the document, then calls add_document_version with external_url to repoint it. Existing share links serve the new URL on the next view.

Notion pages must be public

When you create or repoint a notion document, Papermark verifies the page is publicly accessible at that moment. A private or unshared page is rejected — set the Notion page to "Share to web" first.

Repointing vs. editing

There is no in-place URL edit. PATCH /v1/documents/{id} only renames or moves a document; to change where a link points, add a new version (CLI versions add-link / add-notion, API/MCP external_url). This keeps a full history of where the document has pointed and lets you roll back by promoting an earlier version.

Notes

  • external_url (and the CLI/MCP equivalents) must be HTTPS.
  • A link/notion document can't be turned into a file document (or vice versa) by adding a version — the type is fixed at creation. Sending external_url to a file document, or source_url to a link/notion document, is rejected.
  • The viewer resolves the live URL from the document's primary version, and the API's url field tracks it — both always reflect the latest repoint.

On this page