D
Druckling
Docs

Share links

Give anyone a public, expiring link to a rendered document, without an account or an API key.

A share link is a public, unguessable URL for one rendered document. Whoever has it can open the file in a browser, with no Druckling account and no API key, until the link expires or you revoke it. Use share links to send an invoice to a customer, or to let someone outside your workspace review a contract.

Every rendered document already has a signed download url. A share link is the better choice when a person, not your code, opens the file:

Signed urlShare link
LifetimeUp to 7 days1 to 30 days, 7 by default
RevocableNoYes, effective immediately
ShownOn every read of the documentOnce, when you create it
File nameThe link's path ends in the document IDServed under the document's filename

Both stop working when the document's file is deleted at the end of retention.

REST only for now

The SDKs don't cover share links yet. Call the endpoints below directly with the same API key.

Send POST /v1/documents/{id}/share_links with an optional expires_in_days, a whole number from 1 to 30 (default 7):

curl https://druckling-nine.vercel.app/v1/documents/pdf_8Qw2kLm3nP0aB1cD/share_links \
  -H "Authorization: Bearer $DRUCKLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "expires_in_days": 14 }'

The answer is 201 Created with the link:

Response
{
  "id": "shl_4Fq9LmZ2xR8tKpWc",
  "object": "share_link",
  "document": "pdf_8Qw2kLm3nP0aB1cD",
  "url": "https://druckling-nine.vercel.app/s/k3J9vQ2xLm8RtY5wP1aZc7Nf0bHdx9Qa",
  "hint": "x9Qa",
  "status": "active",
  "expires_at": "2026-11-10T10:02:17.551Z",
  "revoked_at": null,
  "test_mode": true,
  "created_at": "2026-10-27T10:02:17.551Z"
}

What to expect:

  • Only rendered documents can be shared. A document that is queued, rendering or failed answers 409 with code invalid_state ("Only rendered documents can be shared"). So does an expired one ("This document's file was deleted after the retention period").
  • The link never outlives the file. expires_at is the earlier of expires_in_days from now and the document's own expires_at. Asking for 30 days on a document rendered 25 days ago gives a link that works for about 5 more days, without an error, so check expires_at in the response.
  • Out-of-range lifetimes are rejected. An expires_in_days below 1, above 30 or with a fraction fails with 400 BAD_REQUEST.
  • A document can have up to 20 active links. The 21st answers 409 with code conflict. Revoke one first.
  • Any API key works. Both Render only and Full access keys can create, list and revoke share links.
  • Links are free. Creating and opening share links doesn't count toward your plan's quota.

Druckling stores only a SHA-256 hash of each link, never the link itself, so url appears in the create response and nowhere else. Listing or revoking returns url: null. Store the link when you create it, or create a new one if you lose it.

hint holds the link's last four characters, so you and your users can tell links apart (the dashboard shows it as …x9Qa).

What visitors see

Opening the link streams the file itself, with no Druckling page around it:

  • A PDF or PNG opens in the browser, like any file served inline.
  • An XML e-invoice is shown as XML, in a sandbox that keeps it from running anything.
  • Add ?download to the link (for example https://druckling-nine.vercel.app/s/k3J9…x9Qa?download) to have the browser save the file instead of showing it.

The file is served under the document's filename. Responses tell search engines not to index the file, tell browsers and proxies not to cache it, and send no referrer. Nothing in the response names your workspace.

When a link can't be served, the visitor gets a short HTML page instead:

StatusPageWhen
404Link not foundThe link is incomplete or wrong, or it was deleted after it expired.
410This link was revokedYou revoked the link.
410This link has expiredThe link reached its expires_at, or the document's file was deleted.
429Too many requestsToo many requests from one IP address, about 120 a minute. The response has a Retry-After header.

Expired links don't answer 410 forever. A daily cleanup deletes every link whose expires_at has passed, revoked links included. From then on the link answers 404, and it no longer appears when you list the document's links.

GET /v1/documents/{id}/share_links returns every link of the document that hasn't been cleaned up yet, newest first:

curl https://druckling-nine.vercel.app/v1/documents/pdf_8Qw2kLm3nP0aB1cD/share_links \
  -H "Authorization: Bearer $DRUCKLING_API_KEY"
Response
{
  "object": "list",
  "data": [
    {
      "id": "shl_4Fq9LmZ2xR8tKpWc",
      "object": "share_link",
      "document": "pdf_8Qw2kLm3nP0aB1cD",
      "url": null,
      "hint": "x9Qa",
      "status": "active",
      "expires_at": "2026-11-10T10:02:17.551Z",
      "revoked_at": null,
      "test_mode": true,
      "created_at": "2026-10-27T10:02:17.551Z"
    }
  ]
}

A link's status is worked out each time you read it:

statusMeaning
activeThe link works.
expiredThe link reached its expires_at.
revokedYou revoked it; revoked_at says when.

DELETE /v1/documents/{id}/share_links/{share_link_id} stops the link immediately. The next visit gets 410.

curl -X DELETE https://druckling-nine.vercel.app/v1/documents/pdf_8Qw2kLm3nP0aB1cD/share_links/shl_4Fq9LmZ2xR8tKpWc \
  -H "Authorization: Bearer $DRUCKLING_API_KEY"

The response is the link with status: "revoked" and revoked_at set. Revoking a link twice is fine and keeps the first revoked_at. An unknown link, or a link that belongs to another document, answers 404.

A revoked link can't be restored, and no link can be extended. Create a new link instead.

In the dashboard

Open a rendered document in Documents. Under Share links, pick a lifetime in Expires after (1, 7, 14 or 30 days) and click Create link. Copy the link right away with Copy: like the API, the dashboard shows it only once. The list below shows each link's hint, status and expiry, with Revoke next to the active ones.

Test mode

Share links work the same way for test documents. A link's test_mode matches the document it points to.

Security

Treat a share link like the file itself:

  • Links can't be guessed. The part after /s/ is 32 random characters (192 bits), and Druckling keeps only its hash.
  • Anyone with the link can open the file. Send it only to the person who should see the document, over a channel you trust. Forwarding the link forwards access.
  • Keep lifetimes short. Pick the shortest expiry that works for the recipient.
  • Revoke when in doubt. Revoke a link as soon as it's no longer needed, or if it may have leaked.
  • Keep links out of logs. Refer to links by id or hint in your own logs and support tools, not by the full URL.

Next steps

On this page