Developer API

Integrate ThePDF.link's secure document routing into your own applications.

Shorten Document URL

Generate a secure, private preview link for any PDF, DOCX, or PPTX document.

POST/api/shorten

// Request Body

{
  "url": "https://example.com/document.pdf",
  "title": "Optional Title",
  "snippet": "Optional Snippet"
}

// Success Response (200 OK)

{
  "id": "A8X92M",
  "link": "https://thepdf.link/A8X92M?url=...",
  "original_url": "https://example.com/document.pdf"
}

Implementation Example (Node.js)

const response = await fetch('https://thepdf.link/api/shorten', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    url: 'https://example.com/report.pdf'
  })
});

const { link } = await response.json();
console.log('Secure Link:', link);

Usage Limits

Current public API access is rate-limited to 60 requests per minute per IP address. For higher throughput requirements, please contact our infrastructure team.