Skip to main content

Quickstart

Generate your first PDF in under 5 minutes. This guide will walk you through creating an account, getting your API key, and making your first API call.

Prerequisites

  • A Fileloom account (sign up free)
  • An API key
  • A tool to make HTTP requests (cURL, Postman, or any programming language)

Step 1: Get Your API Key

1

Sign Up

Create a free account at app.fileloom.io
2

Navigate to API Keys

Go to SettingsAPI Keys in your dashboard
3

Create a Key

Click Create API Key, give it a name, and copy the key.
Store your API key securely. It won’t be shown again.

Step 2: Generate a PDF from HTML

The simplest way to generate a PDF is by sending raw HTML:
curl -X POST https://api.fileloom.io/v1/pdf \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "htmlContent": "<html><body><h1>Hello, World!</h1><p>My first PDF with Fileloom.</p></body></html>",
    "filename": "hello-world"
  }'

Step 3: Check the Response

A successful response looks like this:
{
  "success": true,
  "requestId": "req_1234567890_abc123",
  "data": {
    "fileId": "file_1234567890_xyz789",
    "url": "https://storage.googleapis.com/fileloom/workspaces/ws_xxx/pdfs/2024/01/hello-world-1234567890.pdf",
    "signedUrl": "https://storage.googleapis.com/fileloom/...",
    "filename": "hello-world.pdf",
    "size": 12345,
    "processingTimeMs": 847,
    "generationMethod": "html"
  },
  "usage": {
    "remaining": 99,
    "quotaUsed": 1,
    "quotaLimit": 100
  }
}
Open the url in your browser to view your PDF!

Step 4: Use a Template (Optional)

For reusable documents, create a template in your dashboard and reference it:
curl -X POST https://api.fileloom.io/v1/pdf \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "templateId": "tpl_your_template_id",
    "templateData": {
      "customerName": "Acme Corp",
      "invoiceNumber": "INV-001",
      "amount": 299.99
    }
  }'

Step 5: Customize Your PDF

Add options to control page size, margins, and more:
{
  "htmlContent": "<html>...</html>",
  "filename": "my-document",
  "options": {
    "format": "A4",
    "orientation": "portrait",
    "margin": {
      "top": 20,
      "right": 15,
      "bottom": 20,
      "left": 15
    },
    "printBackground": true
  }
}

What’s Next?

Troubleshooting

Check that your API key is correct and included in the X-API-Key header.
You’ve used all your monthly quota. Purchase credits or upgrade your plan.
Check the error message for details. Common issues:
  • Missing htmlContent or templateId
  • Invalid templateId
  • htmlContent exceeds size limit
There was an error rendering your HTML. Check for:
  • Invalid HTML syntax
  • External resources that can’t be loaded
  • CSS that causes infinite loops