Skip to main content
The Fileloom API lets you generate PDFs programmatically from HTML templates or raw HTML content.

Base URL

All API requests use the following base URL:
https://api.fileloom.io/v1

Authentication

Authenticate requests using your API key in one of two ways: X-API-Key Header (Recommended):
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>Hello</h1>"}'
Authorization Bearer Token:
curl -X POST https://api.fileloom.io/v1/pdf/generate \
  -H "Authorization: Bearer fl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"htmlContent": "<h1>Hello</h1>"}'
Keep your API key secure. Never expose it in client-side code, public repositories, or browser requests.

Available Endpoints

MethodEndpointDescription
POST/pdf/generateGenerate a PDF from HTML or template

Request Format

All requests must:
  • Use POST method
  • Include Content-Type: application/json header
  • Send a JSON body
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>Hello World</h1>"
  }'

Response Format

All responses are JSON with this structure: Success Response:
{
  "success": true,
  "requestId": "req_1734012345_abc123",
  "data": {
    "fileId": "file_1734012345_xyz789",
    "url": "https://storage.googleapis.com/...",
    "signedUrl": "https://storage.googleapis.com/...",
    "filename": "document.pdf",
    "size": 12847,
    "processingTimeMs": 847,
    "generationMethod": "html"
  },
  "usage": {
    "remaining": 1999,
    "quotaUsed": 1,
    "quotaLimit": 2000
  }
}
Error Response:
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Either htmlContent or templateId is required",
    "requestId": "req_1734012345_abc123",
    "timestamp": "2024-12-15T10:30:00.000Z"
  }
}

Rate Limits

Requests are rate-limited based on your plan:
PlanRequests per Minute
Free60
Starter120
Growth200
Scale400
Scale Business1,000
Scale EnterpriseUnlimited

Rate Limit Headers

Every response includes rate limit information:
X-RateLimit-Limit: 200
X-RateLimit-Remaining: 198
X-RateLimit-Reset: 1734012400
HeaderDescription
X-RateLimit-LimitMaximum requests per minute
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the limit resets

Rate Limit Exceeded

When you exceed the rate limit, you’ll receive a 429 Too Many Requests response:
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Rate limit exceeded. Please retry after 45 seconds.",
    "requestId": "req_1734012345_abc123",
    "timestamp": "2024-12-15T10:30:00.000Z"
  }
}

Timeouts

PDF generation timeouts vary by plan:
PlanTimeout
Free15 seconds
Starter30 seconds
Growth45 seconds
Scale120 seconds
Scale Business240 seconds
Scale Enterprise300 seconds
Complex documents with large images or external resources may require higher-tier plans.

Content Limits

LimitFreeStarterGrowthScaleScale BusinessScale Enterprise
Max HTML Size2 MB5 MB10 MB50 MB100 MB250 MB
Max PDF Size10 MB25 MB50 MB50 MB100 MB250 MB

CORS

The API supports CORS for browser-based requests. However, we strongly recommend making API calls from your server to protect your API key.

Next Steps