How share links work

What is encrypted where, and what reaches the server.

MD2PDF is used through the web editor and the md2pdf-studio command-line tool, which agents run through the skill or the MCP server. This page describes the protocol both speak, so anyone can check what the server receives. It is not a public API: it can change, and pages on other websites cannot call it.

Open the editor Skill and CLI

From the command line

npx -y md2pdf-studio@0.1.3 share report.md
npx -y md2pdf-studio@0.1.3 -h

Encryption

The client generates a random 256-bit key and encrypts the Markdown with AES-256-GCM. What it uploads is base64(IV ‖ ciphertext ‖ tag). The key is base64url-encoded into the link after #k=; browsers never send that part to a server, so md2pdf.studio stores ciphertext it cannot read.

The server rejects plaintext (400 e2ee_required) and any request that carries the key (400 key_leak_blocked). The whole link, including #k=, works like a password: anyone who has it can read the document.

Requests

RequestWhat it does
POST /api/saveStores the ciphertext (header X-Encrypted: aes-256-gcm) and answers { id, editKey, url, expiresAt }. No key in the answer: the server never has it.
PUT /api/update/{id}Replaces the ciphertext. Needs X-Edit-Key; the client reuses the key with a fresh IV.
DELETE /api/delete/{id}Deletes the document. Needs X-Edit-Key.
GET /s/{id}The page that opens a link. Every link gets the same generic preview card in chat apps, because the server cannot read titles.
POST /api/open/{id}Returns the ciphertext of a one-time link once, so link-preview bots cannot use it up.

Optional headers on save and update: X-Expires-In (seconds, 3600 to 2592000; an update can only shorten it) and X-Burn: 1 (save only: a one-time link).

Limits

Writes per address
10 a minute, 100 a day
Document size
500 KB of Markdown
Lifetime
30 days from creation, or less if you choose
Account
None

FAQ

Can I delete a link?

Yes: in the editor from Export → My links, or with md2pdf-studio delete <link> on the machine that created it. Otherwise it expires 30 days after creation.

Can I check the code?

Yes. The web app, the server and the CLI are open source on GitHub.