Skip to main content
Fileloom’s REST API works with any programming language that can make HTTP requests. This section provides complete, copy-paste examples for popular languages.

Available Examples

API Basics

SettingValue
Base URLhttps://api.fileloom.io/v1
EndpointPOST /pdf/generate
Content-Typeapplication/json
AuthenticationX-API-Key: fl_your_api_key

Request Structure

{
  "htmlContent": "<html>...</html>",
  "templateData": { },
  "filename": "document.pdf",
  "options": {
    "format": "A4",
    "margin": { "top": 10, "right": 10, "bottom": 10, "left": 10 }
  }
}
Or with a template:
{
  "templateId": "tpl_your_template_id",
  "templateData": { },
  "filename": "document.pdf"
}

Response Structure

{
  "success": true,
  "requestId": "req_abc123",
  "data": {
    "fileId": "file_xyz789",
    "url": "https://storage.googleapis.com/.../document.pdf",
    "signedUrl": "https://storage.googleapis.com/...?token=...",
    "filename": "document.pdf",
    "size": 45678,
    "processingTimeMs": 1234
  },
  "usage": {
    "remaining": 9500,
    "quotaUsed": 500,
    "quotaLimit": 10000
  }
}

Error Handling

Error CodeDescription
400Invalid request
401Invalid API key
404Template not found
408Request timeout
413File too large
429Rate limit or no credits
500Server error