📚 Complete API Documentation
Fylzap API Reference
Everything you need to integrate file conversions into your application
📋 Quick Navigation
🔐 Authentication
All API requests require authentication using a Bearer token. Get your API key from your dashboard. API access requires a Pro or Enterprise plan.
Using Bearer Token
curl -H "Authorization: Bearer fc_live_your_key_here" \ https://fylzap.com/api/converter
📤 File Conversion
Upload and convert file(s)
Convert one or more files between supported formats. Simple conversions return the file directly; AI mode and Knowledge Pack conversions are queued and return a jobId (or an array of jobs for batches) to poll.
Request Parameters (multipart/form-data)
| Field | Type | Required | Description |
|---|---|---|---|
| files | File (repeatable) | ✓ Yes | One or more files to convert. Repeat this field for multiple files (batch mode). |
| outputType | string | ✓ Yes | md, txt, json, csv, pdf, epub, png, jpg |
| splitMode | string | No | whole (default) or chapters |
| useAI | "true" | "false" | No | AI-powered PDF→MD via LlamaParse. Pro/Enterprise only. Response is queued. |
| useAiClean | "true" | "false" | No | AI Clean formatting pass (Claude). Pro/Enterprise only, consumes a monthly credit. |
| outputMode | string | No | standard (default) or knowledge. knowledge always queues and returns a full AI Knowledge Pack ZIP (document.md, summary.md, chunks.json, entities.json, glossary.json, knowledge_graph.json, chapters/, images/). |
| ocrLanguage | string | No | OCR language code (default "eng") for image→txt conversions. |
Response Shapes
Direct conversions (fast mode, no AI) return the converted file or a ZIP directly. AI mode and Knowledge Pack always return JSON with a job to poll:
// Single job (single file + useAI or outputMode=knowledge)
{
"status": "queued",
"jobId": "abc123",
"pollUrl": "/api/converter/status/abc123"
}// Batch (multiple files + useAI, or multiple files + outputMode=knowledge — Enterprise only)
{
"status": "queued",
"jobs": [
{ "jobId": "abc123", "pollUrl": "/api/converter/status/abc123" },
{ "jobId": "def456", "pollUrl": "/api/converter/status/def456" }
],
"message": "2 Knowledge Packs queued. Poll each jobId for its result."
}Supported Conversions
🧠 Knowledge Pack
- • PDF/DOCX/MD → Knowledge Pack ZIP
- • Cleaned Markdown, summary, chunks, TOC, keywords, entities, glossary, knowledge graph, images
- • Pro/Enterprise (1 free trial on Free plan)
📄 Documents
- • PDF → MD, TXT, JSON, PNG, JPG
- • DOCX → MD, TXT
- • MD → PDF, EPUB
- • LaTeX → PDF
- • OpenAPI/YAML → MD
- • Image → TXT (OCR)
📊 Data
- • CSV → JSON
- • JSON → CSV
Example: Basic conversion
curl -X POST https://fylzap.com/api/converter \ -H "Authorization: Bearer fc_live_your_key" \ -F "files=@document.pdf" \ -F "outputType=md" \ -o result.md
⚠️ This direct upload works for files under ~4.5 MB. For larger files (most real-world PDFs) or AI mode / Knowledge Pack, use the two-step upload flow instead — see below.
Example: AI mode with chapters
curl -X POST https://fylzap.com/api/converter \ -H "Authorization: Bearer fc_live_your_key" \ -F "files=@document.pdf" \ -F "outputType=md" \ -F "splitMode=chapters" \ -F "useAiClean=true"
Example: Generate a Knowledge Pack
curl -X POST https://fylzap.com/api/converter \ -H "Authorization: Bearer fc_live_your_key" \ -F "files=@document.pdf" \ -F "outputType=md" \ -F "outputMode=knowledge"
📤 Uploading Large Files
/api/converter accepts requests directly up to ~4.5 MB total. For larger files — and for AI mode or Knowledge Pack conversions, which typically involve bigger documents — use the two-step upload flow below instead. It uploads your file directly to our processing worker, so there's no practical size limit beyond your plan's file size cap.
Request an upload authorization
Step 2 — Upload the file to uploadUrl
POST the file as multipart/form-data directly to the worker, using uploadToken as the bearer token (not your API key):
curl -X POST "${uploadUrl}/upload" \
-H "Authorization: Bearer ${uploadToken}" \
-F "file=@document.pdf"Then poll /api/converter/status/{jobId} and download from /api/converter/download/{jobId} as usual once status is success.
Tip: our official Node.js and Python examples below handle this automatically — they pick the right flow based on file size, so you don't need to implement this yourself unless you're calling the API directly.
📦 Batch Knowledge Pack
Enterprise plan only. Queue a Knowledge Pack for multiple files in one workflow. Each file consumes one unit from your monthly Knowledge Pack quota (100/month by default).
Recommended: authorize and upload each file individually via /api/converter/authorize, then poll and download each resulting jobId. This works for files of any size and is what the examples below use.
Python — Batch Knowledge Pack
import os
import time
import requests
API_KEY = 'fc_live_your_enterprise_key'
BASE_URL = 'https://fylzap.com'
HEADERS = {'Authorization': f'Bearer {API_KEY}'}
def authorize_and_upload(file_path):
file_name = os.path.basename(file_path)
file_size = os.path.getsize(file_path)
auth = requests.post(
f'{BASE_URL}/api/converter/authorize',
headers=HEADERS,
json={
'fileName': file_name,
'fileSize': file_size,
'outputType': 'md',
'splitMode': 'chapters',
'useAI': file_name.lower().endswith('.pdf'),
'useAiClean': True,
'outputMode': 'knowledge',
},
).json()
with open(file_path, 'rb') as f:
requests.post(
f"{auth['uploadUrl']}/upload",
headers={'Authorization': f"Bearer {auth['uploadToken']}"},
files={'file': f},
)
return auth['jobId'], file_name
def wait_and_download(job_id, file_name, output_dir='.'):
while True:
status = requests.get(
f'{BASE_URL}/api/converter/status/{job_id}', headers=HEADERS
).json()
if status['status'] == 'success':
break
if status['status'] == 'error':
raise Exception(f"{file_name}: {status.get('error')}")
time.sleep(3)
result = requests.get(
f'{BASE_URL}/api/converter/download/{job_id}', headers=HEADERS
)
base_name = os.path.splitext(file_name)[0]
out_path = os.path.join(output_dir, f'{base_name}_knowledge_pack.zip')
with open(out_path, 'wb') as f:
f.write(result.content)
print(f'Saved: {out_path}')
def generate_knowledge_packs_batch(file_paths, output_dir='.'):
jobs = [authorize_and_upload(p) for p in file_paths]
for job_id, file_name in jobs:
wait_and_download(job_id, file_name, output_dir)
generate_knowledge_packs_batch([
'document1.pdf',
'document2.pdf',
'document3.docx',
])JavaScript / Node.js — Batch Knowledge Pack
const FormData = require('form-data');
const fs = require('fs');
const path = require('path');
const axios = require('axios');
const API_KEY = 'fc_live_your_enterprise_key';
const BASE_URL = 'https://fylzap.com';
async function authorizeAndUpload(filePath) {
const fileName = path.basename(filePath);
const fileSize = fs.statSync(filePath).size;
const { data: auth } = await axios.post(
`${BASE_URL}/api/converter/authorize`,
{
fileName, fileSize,
outputType: 'md',
splitMode: 'chapters',
useAI: fileName.toLowerCase().endsWith('.pdf'),
useAiClean: true,
outputMode: 'knowledge',
},
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const form = new FormData();
form.append('file', fs.createReadStream(filePath), fileName);
await axios.post(`${auth.uploadUrl}/upload`, form, {
headers: { ...form.getHeaders(), Authorization: `Bearer ${auth.uploadToken}` },
maxContentLength: Infinity,
maxBodyLength: Infinity,
});
return { jobId: auth.jobId, fileName };
}
async function waitAndDownload(jobId, fileName, outDir = '.') {
while (true) {
const { data: status } = await axios.get(
`${BASE_URL}/api/converter/status/${jobId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
if (status.status === 'success') break;
if (status.status === 'error') throw new Error(`${fileName}: ${status.error}`);
await new Promise(r => setTimeout(r, 3000));
}
const result = await axios.get(
`${BASE_URL}/api/converter/download/${jobId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` }, responseType: 'arraybuffer' }
);
const baseName = path.basename(fileName, path.extname(fileName));
const outPath = path.join(outDir, `${baseName}_knowledge_pack.zip`);
fs.writeFileSync(outPath, result.data);
console.log('Saved:', outPath);
}
async function generateKnowledgePacksBatch(filePaths, outDir = '.') {
const jobs = [];
for (const p of filePaths) jobs.push(await authorizeAndUpload(p));
for (const { jobId, fileName } of jobs) await waitAndDownload(jobId, fileName, outDir);
}
generateKnowledgePacksBatch(['document1.pdf', 'document2.pdf', 'document3.docx']);Alternative: single multipart request (small files only, under ~4 MB combined)
For quick tests with small files, you can send all files in one request instead:
curl -X POST https://fylzap.com/api/converter \ -H "Authorization: Bearer fc_live_your_enterprise_key" \ -F "files=@document1.pdf" \ -F "files=@document2.pdf" \ -F "files=@document3.docx" \ -F "outputType=md" \ -F "outputMode=knowledge"
This has the same combined-request-size limit described in Uploading Large Files. Use the authorize-per-file flow above for anything beyond trivial file sizes.
Non-Enterprise plans (or trial users) attempting a batch Knowledge Pack receive a 403.
⏱️ Job Tracking
Check job status and progress
Download converted file
👤 User & Quota
Check usage quota
🔑 API Key Management
List API keys
Create new API key
📋 Conversion History
Get conversion history
Re-download a past conversion
⚠️ Error Handling
⚡ Plan Limits
Free
Conversions: 10/day
Max file: 10 MB/file
3 one-time AI conversions
1 free Knowledge Pack trial
Pro
Conversions: 500/month
Max file: 100 MB/file
50 AI conversions/mo, 50 AI Clean credits/mo
20 Knowledge Packs/month
Enterprise
Conversions: 2000/month
Max file: 500 MB/file
300 AI conversions/mo, 500 AI Clean credits/mo
100 Knowledge Packs/month, batch supported
💻 Code Examples
JavaScript / Node.js — Knowledge Pack
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const API_KEY = 'fc_live_your_key';
const BASE_URL = 'https://fylzap.com';
async function generateKnowledgePack(filePath) {
const fileName = require('path').basename(filePath);
const fileSize = fs.statSync(filePath).size;
// 1. Authorize — always used for Knowledge Pack, since these files
// tend to exceed the ~4.5 MB direct-upload limit
const { data: auth } = await axios.post(
`${BASE_URL}/api/converter/authorize`,
{
fileName, fileSize,
outputType: 'md',
splitMode: 'chapters',
useAI: fileName.toLowerCase().endsWith('.pdf'),
useAiClean: true,
outputMode: 'knowledge',
},
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
// 2. Upload directly to the worker
const form = new FormData();
form.append('file', fs.createReadStream(filePath), fileName);
await axios.post(`${auth.uploadUrl}/upload`, form, {
headers: { ...form.getHeaders(), Authorization: `Bearer ${auth.uploadToken}` },
maxContentLength: Infinity,
maxBodyLength: Infinity,
});
console.log('Queued:', auth.jobId);
// 3. Poll until done
let result;
while (true) {
const { data: status } = await axios.get(
`${BASE_URL}/api/converter/status/${auth.jobId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
if (status.status === 'success') { result = status; break; }
if (status.status === 'error') throw new Error(status.error);
console.log(`Progress: ${status.progress ?? 0}%`);
await new Promise(r => setTimeout(r, 3000));
}
// 4. Download
const file = await axios.get(
`${BASE_URL}/api/converter/download/${auth.jobId}`,
{ headers: { Authorization: `Bearer ${API_KEY}` }, responseType: 'arraybuffer' }
);
fs.writeFileSync('knowledge_pack.zip', file.data);
console.log('Saved knowledge_pack.zip');
}
generateKnowledgePack('document.pdf');Python — Knowledge Pack
import os
import time
import requests
API_KEY = 'fc_live_your_key'
BASE_URL = 'https://fylzap.com'
HEADERS = {'Authorization': f'Bearer {API_KEY}'}
def generate_knowledge_pack(file_path):
file_name = os.path.basename(file_path)
file_size = os.path.getsize(file_path)
# 1. Authorize
auth = requests.post(
f'{BASE_URL}/api/converter/authorize',
headers=HEADERS,
json={
'fileName': file_name,
'fileSize': file_size,
'outputType': 'md',
'splitMode': 'chapters',
'useAI': file_name.lower().endswith('.pdf'),
'useAiClean': True,
'outputMode': 'knowledge',
},
).json()
# 2. Upload directly to the worker
with open(file_path, 'rb') as f:
requests.post(
f"{auth['uploadUrl']}/upload",
headers={'Authorization': f"Bearer {auth['uploadToken']}"},
files={'file': f},
)
job_id = auth['jobId']
print(f'Queued: {job_id}')
# 3. Poll until done
while True:
status = requests.get(
f'{BASE_URL}/api/converter/status/{job_id}', headers=HEADERS
).json()
if status['status'] == 'success':
break
if status['status'] == 'error':
raise Exception(status.get('error'))
print(f"Progress: {status.get('progress', 0)}%")
time.sleep(3)
# 4. Download
result = requests.get(
f'{BASE_URL}/api/converter/download/{job_id}', headers=HEADERS
)
with open('knowledge_pack.zip', 'wb') as f:
f.write(result.content)
print('Saved knowledge_pack.zip')
generate_knowledge_pack('document.pdf')📞 Support & Resources
- • 🔗 Dashboard: Manage API keys and view usage
- • 🛠️ CLI Tool:
npm install -g fylzap - • ✉️ Support: support@fylzap.com