Skip to main content

Prerequisites

Before you begin, you’ll need:
  • A Fileloom account — Sign up free
  • An API key from your dashboard

Step 1: Get Your API Key

1

Sign in to Dashboard

Go to app.fileloom.io and sign in with Email, Google, or GitHub.
2

Navigate to API Keys

Click API Keys in the sidebar.
3

Create New Key

Click Create API Key, give it a name, and copy the key immediately — it won’t be shown again.
Store your API key securely. It provides full access to your workspace and cannot be retrieved after creation.

Step 2: Generate Your First PDF

curl -X POST https://api.fileloom.io/v1/pdf/generate \
  -H "X-API-Key: fl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "htmlContent": "<html><body><h1>My First PDF</h1><p>Generated with Fileloom!</p></body></html>"
  }'

Step 3: View Your PDF

The response includes a url field with a direct link to your generated PDF:
Response
{
  "success": true,
  "requestId": "req_1734012345_abc123",
  "data": {
    "fileId": "file_1734012345_xyz789",
    "url": "https://storage.googleapis.com/fileloom-prod/workspaces/ws_.../document.pdf",
    "signedUrl": "https://storage.googleapis.com/fileloom-prod/...",
    "filename": "document.pdf",
    "size": 8234,
    "processingTimeMs": 623,
    "generationMethod": "html"
  },
  "usage": {
    "remaining": 1999,
    "quotaUsed": 1,
    "quotaLimit": 2000
  }
}
  • url — Permanent public URL (valid until retention period expires)
  • signedUrl — Temporary secure URL (valid for 24 hours)

Step 4: Add Dynamic Data

Use Handlebars syntax to inject dynamic content:
curl -X POST https://api.fileloom.io/v1/pdf/generate \
  -H "X-API-Key: fl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "htmlContent": "<h1>Invoice #{{invoiceNumber}}</h1><p>Amount: {{currency amount \"USD\"}}</p><p>Due: {{formatDate dueDate \"MMMM D, YYYY\"}}</p>",
    "templateData": {
      "invoiceNumber": "INV-2024-001",
      "amount": 299.99,
      "dueDate": "2024-12-31"
    }
  }'
This generates a PDF with:
  • Invoice #INV-2024-001
  • Amount: $299.99
  • Due: December 31, 2024

Step 5: Create a Reusable Template

For repeated use, create a template in the dashboard:
1

Open Template Editor

Go to TemplatesCreate Template in the dashboard.
2

Design Your Template

Write HTML in the editor, add CSS styling, and use {{variables}} for dynamic content.
3

Test with Sample Data

Enter test JSON in the Test Data tab and preview your PDF in real-time.
4

Publish

Click Publish to make the template available via API.
5

Use via API

Reference your template by ID instead of sending raw HTML:
curl -X POST https://api.fileloom.io/v1/pdf/generate \
  -H "X-API-Key: fl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "tpl_your_template_id",
    "templateData": {
      "invoiceNumber": "INV-2024-002",
      "amount": 599.99,
      "dueDate": "2025-01-15"
    }
  }'

What’s Next?