PDF Storage & Shareable URLs

Every PDF you generate is automatically stored in the cloud and gets a unique shareable URL. No extra API calls needed.

How It Works

When you generate any PDF (invoice, receipt, quote, etc.), three things happen automatically:

  1. 1.The PDF is returned to you as binary (existing behavior, unchanged)
  2. 2.The PDF is stored in our cloud storage
  3. 3.A shareable URL is returned in the X-Kagyz-Document-URL response header

Shareable URL

Each stored PDF gets a URL like:

bash
https://file.kagyz.com/a1b2c3d4e5f6071890abcdef12345678

No authentication is needed to view the PDF — anyone with the link can access it, similar to Stripe receipts. The token is a random 32-character hex string, making URLs unguessable.

Response Header

The shareable URL is returned in the X-Kagyz-Document-URL response header on every PDF generation request.

bash
curl -X POST https://api.kagyz.com/v1/invoice \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"invoice_number": "INV-001",
"issue_date": "Mar 19, 2026",
"from": { "name": "Acme Inc" },
"to": { "name": "Client Corp" },
"items": [{ "description": "Services", "quantity": 1, "unit_price": 500 }]
}' \
--output invoice.pdf -v
# Response headers include:
# X-Kagyz-Document-URL: https://file.kagyz.com/a1b2c3d4e5f60718...
javascript
const response = await fetch('https://api.kagyz.com/v1/invoice', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
invoice_number: 'INV-001',
issue_date: 'Mar 19, 2026',
from: { name: 'Acme Inc' },
to: { name: 'Client Corp' },
items: [{ description: 'Services', quantity: 1, unit_price: 500 }]
})
});
// Get the shareable URL from the response header
const documentUrl = response.headers.get('X-Kagyz-Document-URL');
console.log('Shareable URL:', documentUrl);
// → https://file.kagyz.com/a1b2c3d4e5f60718...
// PDF binary is still in the response body
const blob = await response.blob();

Dashboard

All stored documents are listed in your dashboard at app.kagyz.com/documents. From there you can:

  • View all generated documents with metadata
  • Copy shareable links to clipboard
  • Download PDFs directly
  • Filter by document type
  • Delete documents (removes from storage permanently)

Storage Limits

Each plan includes a storage allowance for generated PDFs:

PlanStorage~PDFs
Free500 MB~10,000
Starter5 GB~100,000
Growth50 GB~1,000,000

If your storage is full, PDFs are still generated and returned normally — they just won't be stored or get a shareable URL. The API request will not fail.

Storage is automatic — there is no opt-in or configuration required. Every PDF generation request stores the document and returns the URL header.