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.The PDF is returned to you as binary (existing behavior, unchanged)
- 2.The PDF is stored in our cloud storage
- 3.A shareable URL is returned in the
X-Kagyz-Document-URLresponse header
Shareable URL
Each stored PDF gets a URL like:
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.
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...
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 headerconst 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 bodyconst 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:
| Plan | Storage | ~PDFs |
|---|---|---|
| Free | 500 MB | ~10,000 |
| Starter | 5 GB | ~100,000 |
| Growth | 50 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.