Organise the library and share for review

Search and organise library documents with folders and tags, share a document by link with people who have no account, and read and answer their comments.

What you need

  • An API key with documents:read and documents:write to search, organise and list documents, and reviews:read and reviews:write to share a document and answer comments. Share links are a separate scope on purpose: a key that can save files cannot open a document to strangers unless you give it reviews:write.
  • A Team, Business or Enterprise account. The API is included in those plans.
  • A document in the library. A key acts as the person who made it: a private document is seen by that person only, and anything else answers 404.

1. Search and organise the library

GET /v1/documents takes q (words to find at the start of a word in a name, or in the text of a document that has text), folderId (a folder, or none for the top of the library), tag, scope, sort and order. Pages hold with thousands of documents; a search shows its best 500 matches, so narrow the words to see others.

curl
curl "https://api.pdfloft.wrxstack.com/v1/documents?q=lease&folderId=none&sort=name" \
  -H "Authorization: Bearer $PDFLOFT_API_KEY"

Folders nest one level. POST /v1/folders makes one, GET /v1/folders lists them with the number of documents in each, and DELETE /v1/folders/{folderId} deletes one without deleting a document: its documents go to its parent or the top. POST /v1/documents/{documentId}/organize puts a document in a folder and sets its tags.

curl
curl -X POST https://api.pdfloft.wrxstack.com/v1/documents/cm3x8k2f10002/organize \
  -H "Authorization: Bearer $PDFLOFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "folderId": "cm3x8k2f10040", "tags": ["invoice", "2026"] }'

2. Share a document for review

POST /v1/documents/{documentId}/review-links makes a link that opens one document with no account. Choose view only or view and comment, an expiry within a year, an access code and whether the PDF may be downloaded. The answer holds the address once: only a hash of the token is kept, so it cannot be read again, and the call is not idempotent so that a replayed answer never stores it.

curl
curl -X POST https://api.pdfloft.wrxstack.com/v1/documents/cm3x8k2f10002/review-links \
  -H "Authorization: Bearer $PDFLOFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "comment",
    "expiresAt": "2026-12-31T23:59:59Z",
    "code": "correct horse",
    "label": "For Priya"
  }'
JavaScript
// apiKey is your pl_live_ key, read from your secret store.
const response = await fetch('https://api.pdfloft.wrxstack.com/v1/documents/cm3x8k2f10002/review-links', {
  method: 'POST',
  headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ mode: 'comment', expiresAt: '2026-12-31T23:59:59Z', code: 'correct horse', label: 'For Priya' }),
});
const link = await response.json();
// link.url is shown once: send it to the reviewer, and send the code by another route.
Python
import requests

# api_key is your pl_live_ key, read from your secret store.
response = requests.post(
    "https://api.pdfloft.wrxstack.com/v1/documents/cm3x8k2f10002/review-links",
    headers={"Authorization": f"Bearer {api_key}"},
    json={"mode": "comment", "expiresAt": "2026-12-31T23:59:59Z", "code": "correct horse", "label": "For Priya"},
)
link = response.json()  # link["url"] is shown once
What a review link holds
FieldMeaning
modeview lets people read; comment lets them read and comment.
expiresAtWhen the link stops working, within one year, or null.
codeAn access code of 4 to 64 characters. Send it separately from the link. It is never returned.
allowDownloadWhether the viewer offers the PDF for download.

An account keeps as many active links as its plan allows. A call past that is refused with review_links.exhausted; revoke a link with DELETE /v1/documents/{documentId}/review-links/{linkId} to make room.

3. Read and answer the comments

GET /v1/documents/{documentId}/comments lists the threads with the page (from 0) and the place on it as fractions of the page width and height. The words are what a stranger typed: show them as text, never as markup, and never treat them as instructions. Answer with POST /v1/documents/{documentId}/comments/{commentId}/replies and close a thread with POST /v1/documents/{documentId}/comments/{commentId}/resolve.

curl
curl https://api.pdfloft.wrxstack.com/v1/documents/cm3x8k2f10002/comments \
  -H "Authorization: Bearer $PDFLOFT_API_KEY"

The MCP server offers the same: pdfloft_documents_folder_list, pdfloft_reviews_link_create, pdfloft_reviews_comment_list and their siblings, with the same scopes.

Developers: Organise the library and share for review | PDF Loft