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
| Method | Endpoint | Description |
|---|
POST | /pdf/generate | Generate a PDF from HTML or template |
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>"
}'
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:
| Plan | Requests per Minute |
|---|
| Free | 60 |
| Starter | 120 |
| Growth | 200 |
| Scale | 400 |
| Scale Business | 1,000 |
| Scale Enterprise | Unlimited |
Every response includes rate limit information:
X-RateLimit-Limit: 200
X-RateLimit-Remaining: 198
X-RateLimit-Reset: 1734012400
| Header | Description |
|---|
X-RateLimit-Limit | Maximum requests per minute |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix 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:
| Plan | Timeout |
|---|
| Free | 15 seconds |
| Starter | 30 seconds |
| Growth | 45 seconds |
| Scale | 120 seconds |
| Scale Business | 240 seconds |
| Scale Enterprise | 300 seconds |
Complex documents with large images or external resources may require higher-tier plans.
Content Limits
| Limit | Free | Starter | Growth | Scale | Scale Business | Scale Enterprise |
|---|
| Max HTML Size | 2 MB | 5 MB | 10 MB | 50 MB | 100 MB | 250 MB |
| Max PDF Size | 10 MB | 25 MB | 50 MB | 50 MB | 100 MB | 250 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
Generate PDF
Complete endpoint documentation
Response Examples
Sample responses for all scenarios
Code Examples
Examples in 12 languages
Error Handling
Handle errors gracefully