API Reference
How to authenticate a request with an API key, the response shape every FlexFiles API endpoint uses, and how to submit, poll, and fetch results for every conversion tool FlexFiles offers.
The conversion API is live and callable with any active API key, covering every conversion tool FlexFiles offers. Generate a key from Account settings, then use the examples below to submit a conversion, poll its status, and fetch the result.
Authenticating a request
Every request to the FlexFiles public API sends the raw API key in a header. No session cookie or login step is needed.
X-Api-Key: ff_your_key_hereSubmitting a conversion
Send the file(s) and the action name as multipart form data. Actions that take extra parameters (a password, search text, a page range, and so on) send them as additional form fields — see the table below for which action needs what. Each request counts as one conversion against your plan's quota, and each action accepts a fixed number of files per request (most take a single file — see Files for each tool below); sending more is rejected with a 422.
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-wordA successful request returns immediately with a queued conversion ID — conversions always run asynchronously through this API, so a slow action (like OCR) never holds the connection open:
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}Poll for status with the conversion ID:
GET https://api.flexfiles.io/api/v1/conversions/{conversion_id}
X-Api-Key: ff_your_key_here
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"action": "pdf-to-word",
"status": "completed",
"files": [{ "name": "document.pdf" }],
"createdAt": "2026-10-19T12:00:00Z",
"completedAt": "2026-10-19T12:00:04Z"
},
"errors": null
}status moves through queued → processing → completed or failed. A failed conversion also carries an error message, and a conversion created with a webhookUrl carries webhookDeliveryStatus once delivery has been attempted.
Once status is completed, fetch a ready-to-download result URL (freshly signed on every call, valid for one hour):
GET https://api.flexfiles.io/api/v1/conversions/{conversion_id}/result
X-Api-Key: ff_your_key_here
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b8...",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}zipUrl is present on every completed conversion, for every action — even a single file, and even actions that produce one combined output (like merge-pdf). resultUrl always points at the primary/first output file directly; use zipUrl if you submitted multiple files and want every output in one download.
Webhooks (push notifications)
Instead of polling, pass an optional webhookUrl form field when creating a conversion. It must be an https:// URL of at most 2,048 characters that doesn't resolve to a private or internal address — invalid URLs are rejected immediately with a 422, before any file is uploaded.
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-word
webhookUrl=https://your-app.example.com/flexfiles-hookOnce the conversion reaches a terminal status, FlexFiles sends a thin notification — intentionally no download link — so a compromised or misconfigured endpoint never receives an actual result URL. Fetch the real result with your API key:
POST https://your-app.example.com/flexfiles-hook
Content-Type: application/json
X-FlexFiles-Signature: t=1700000000,v1=5257a869e7bcd...
{
"event": "conversion.completed",
"eventId": "6ad5b5b83729b8fd4c0335e8:completed",
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"timestamp": "2026-10-19T12:00:00+00:00"
}A retry of the same notification (e.g. if your endpoint was briefly unreachable) resends the same eventId with a fresh timestamp — dedupe on eventId, not on the full payload, if you need exactly-once processing.
Respond with any 2xx status within 8 seconds — only the status code is read, so acknowledge first and do slow work afterwards. Timeouts, connection errors, and 408, 429 or 5xx responses are retried a few times with backoff; any other status, including redirects (which are never followed), is final. An endpoint that keeps failing is paused for a while, so check webhookDeliveryStatus or poll if a notification doesn't arrive.
Verify the signature before trusting the payload: recompute HMAC-SHA256 over {timestamp}.{raw body} using the webhook signing secret shown once when you generated your API key, and compare it to v1 with a constant-time comparison:
import hmac, hashlib
def verify(secret, signature_header, raw_body):
parts = dict(p.split("=", 1) for p in signature_header.split(","))
signed = f"{parts['t']}.{raw_body}"
expected = hmac.new(secret.encode(), signed.encode(), hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])Response envelope
Every FlexFiles API response, success or error, uses the same envelope shape:
{
"status": true,
"statusCode": 200,
"message": null,
"data": { "...": "..." },
"errors": null
}Supported conversion actions
Every conversion tool FlexFiles offers is available through the API — pass the action code as the action field. Expand a tool below for its exact request payload and response. A field not required and not sent is simply ignored; a required field that's missing returns a 422 with a clear message before anything uploads.
▶PDF to JPGpdf-to-jpg
Rasterize each page of a PDF to a JPG image.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| selectedPages | No | Comma-separated page numbers/ranges. Omit to convert every page. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-jpg
selectedPages=1,3,5-7Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}zipUrl contains one JPG per page; resultUrl points at the first page's JPG.
▶PDF to Wordpdf-to-word
Convert a PDF into an editable Word (.docx) document.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| selectedPages | No | Comma-separated page numbers/ranges. Omit to convert every page. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-word
selectedPages=1,3,5-7Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶PDF to PowerPointpdf-to-pptx
Convert a PDF into an editable PowerPoint (.pptx) deck.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| selectedPages | No | Comma-separated page numbers/ranges. Omit to convert every page. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-pptx
selectedPages=1,3,5-7Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶PDF to HTMLpdf-to-html
Convert a PDF into a standalone HTML file.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-htmlExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶PDF to TXTpdf-to-txt
Extract a PDF's plain text content.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-txtExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶PDF to Excelpdf-to-excel
Extract tables from a PDF into an Excel (.xlsx) workbook.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=pdf-to-excelExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Extract PDF Imagesextract-pdf-images
Pull every embedded image out of a PDF.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=extract-pdf-imagesExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}zipUrl contains every extracted image; resultUrl points at the first one.
▶HTML to PDFhtml-to-pdf
Render an uploaded .html file to PDF.
Files: 1 .html file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=html-to-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶JPG to PDFjpg-to-pdf
Place one or more images onto PDF pages.
Files: 1 to 10 image files
| Field | Required | Notes |
|---|---|---|
| pageSize | No | a4 (default), a3, a5, letter, legal. |
| orientation | No | portrait (default) or landscape. |
| margin | No | Integer pixels (default 10). |
| quality | No | 1-100 JPEG quality (default 80). |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=jpg-to-pdf
pageSize=a4
orientation=portrait
margin=10
quality=80Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Word to PDFword-to-pdf
Convert a Word document (.doc/.docx) to PDF.
Files: 1 Word document
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=word-to-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Merge PDFmerge-pdf
Combine multiple PDFs into a single document, in the order submitted.
Files: 2 to 3 PDF files
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@first.pdf
files[]=@second.pdf
action=merge-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Split PDFsplit-pdf
Split a PDF into multiple smaller PDFs of a fixed page count each.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| splitPages | Yes | Pages per output chunk. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=split-pdf
splitPages=2Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}zipUrl contains every chunk; resultUrl points at the first one.
▶Compress PDFcompress-pdf
Reduce a PDF's file size.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| compressionLevel | No | Integer 1-100 (default 50) — higher means smaller/more lossy. |
| compressionPreset | No | minimal, balanced (default), or maximum. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=compress-pdf
compressionLevel=50
compressionPreset=balancedExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Protect PDFprotect-pdf
Add a password to a PDF.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| password | Yes | — |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=protect-pdf
password=S3cur3Pass!Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Unlock PDFunlock-pdf
Remove a password from a PDF.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| password | Yes | The PDF's current password. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=unlock-pdf
password=S3cur3Pass!Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Repair PDFrepair-pdf
Attempt to fix a corrupted or malformed PDF.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| password | No | If the PDF being repaired is password-protected. |
| ocrLanguage | No | Hint if repair needs to re-OCR any pages. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=repair-pdf
password=S3cur3Pass!
ocrLanguage=engExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Flatten PDFflatten-pdf
Flatten form fields and layers into static page content.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=flatten-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Deskew PDFdeskew-pdf
Straighten crooked/skewed scanned pages.
Files: 1 PDF file
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=deskew-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶OCR PDFocr-pdf
Make a scanned PDF's text searchable/selectable.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| ocrLanguage | No | Tesseract language code, or several joined with + (e.g. eng+fra). Installed: eng, spa, fra, deu, por, ita, rus, ukr, tur, ell, ara, hin, chi_sim, chi_tra, jpn, kor. Omit it to read English. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=ocr-pdf
ocrLanguage=engExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Remove Annotationsremove-annotations
Strip annotations, form fields and/or links from a PDF, with per-category control.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| removeHighlights | No | Highlight/underline/squiggly/strikeout marks. |
| removeComments | No | Sticky notes and FreeText callouts. |
| removeDrawings | No | Ink/shapes/stamps and other markup. |
| removeFormFields | No | Fillable fields (never removes a signed signature field). |
| removeLinks | No | Hyperlinks. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=remove-annotations
removeHighlights=true
removeComments=true
removeDrawings=true
removeFormFields=true
removeLinks=trueExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}All five default to true (remove everything) if none are specified. Set the ones you want to keep to false.
▶Remove PDF Pagesremove-pdf-pages
Delete specific pages from a PDF.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| pagesToRemove | Yes | — |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=remove-pdf-pages
pagesToRemove=2,4,7-9Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Add Pages to PDFadd-page-to-pdf
Insert all pages of one PDF into another at a specific position.
Files: exactly 2 PDF files (the main document, then the pages to insert)
| Field | Required | Notes |
|---|---|---|
| position | Yes | 1-based page number of the main document to insert after (must be 1 or greater). |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@first.pdf
files[]=@second.pdf
action=add-page-to-pdf
position=3Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Add Header & Footeradd-header-footer
Add header and/or footer text to a PDF's pages.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| headerText | No | At least one of headerText/footerText should be set, or nothing visible changes. |
| footerText | No | — |
| pageNumbers | No | all (default) or comma-separated page numbers. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=add-header-footer
headerText=Confidential
footerText=Confidential
pageNumbers=allExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Add Link to PDFadd-link-to-pdf
Make URLs/emails in a PDF clickable, link specific text, or draw a brand-new clickable link at an exact position. Three combinable modes — a bare request already works via autoLink.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| autoLink | No | Default true: auto-detect and link URLs/emails found in the text. |
| linkText | No | Paired with linkUrl for a single specific-text-to-URL link. |
| linkUrl | No | Paired with linkText. |
| manualLinks | No | JSON array of text/url pairs, for linking several specific pieces of text. |
| newLinks | No | JSON array to draw brand-new clickable text at an exact position (optional styling: size, bold, italic, underline, font, color). |
| pageNumbers | No | Scopes autoLink's auto-detection to specific pages. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=add-link-to-pdfExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}At least one of autoLink/manualLinks/newLinks/linkText+linkUrl must apply — autoLink defaults to true, so omitting every field still works. Explicitly setting autoLink=false with nothing else returns a 422.
▶Search and Replacesearch-and-replace
Find and replace text within a PDF.
Files: 1 PDF file
| Field | Required | Notes |
|---|---|---|
| searchText | Yes | — |
| replaceText | Yes | — |
| pageOption | No | all (default), specific, or range — specificPage/pageRange below are alternatives depending on this. |
| specificPage | No | Required if pageOption=specific. |
| pageRange | No | Required if pageOption=range. Also accepts "1, 4, 6-8". |
| ocrLanguage | No | If the PDF needs OCR before text can be found. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=search-and-replace
searchText=Acme Corp
replaceText=Acme Inc.Example response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}The example above uses the pageOption=all default. Send pageOption=specific with specificPage, or pageOption=range with pageRange, to scope the replacement to fewer pages.
▶Convert Imageconvert-image
Convert an image to a different format.
Files: 1 to 5 image files
| Field | Required | Notes |
|---|---|---|
| outPutFormat | No | Target format, e.g. PNG (default), JPEG, WEBP. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=convert-image
outPutFormat=PNGExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Enhance Imageenhance-image
Upscale and sharpen an image.
Files: 1 to 5 image files
| Field | Required | Notes |
|---|---|---|
| enhanceScale | No | 1, 2, or 4 (default 2) — upscale factor. |
| enhanceStrength | No | low, balanced (default), or high. |
| outPutFormat | No | PNG (default), JPEG, WEBP. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=enhance-image
enhanceScale=2
enhanceStrength=balanced
outPutFormat=PNGExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}▶Remove Backgroundremove-background
Remove an image's background — make it transparent, a solid color, or composite a new background image.
Files: 1 to 3 image files
| Field | Required | Notes |
|---|---|---|
| backgroundType | No | transparent (default), color, or image. |
| backgroundColor | No | Hex color, used when backgroundType=color. |
| backgroundImage (file) | Conditional | Second file (not part of files[]) with the replacement background — only used (and required) when backgroundType=image. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=remove-background
backgroundType=color
backgroundColor=#ffffffExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}Shown here with backgroundType=color. Omit both fields for the default transparent background, or set backgroundType=image and attach backgroundImage instead of backgroundColor.
▶Compress Imagetiny-image
Reduce an image's file size.
Files: 1 to 10 image files
| Field | Required | Notes |
|---|---|---|
| compressionLevel | No | Integer 1-100 (default 50) — higher means smaller/more lossy. |
| compressionPreset | No | minimal, balanced (default), or maximum. |
Example request
POST https://api.flexfiles.io/api/v1/conversions
X-Api-Key: ff_your_key_here
Content-Type: multipart/form-data
files[]=@document.pdf
action=tiny-image
compressionLevel=50
compressionPreset=balancedExample response
{
"status": true,
"statusCode": 202,
"message": "Your file has been queued for processing.",
"data": { "conversionId": "6ad5b5b83729b8fd4c0335e8", "status": "queued" },
"errors": null
}
// then, once GET /conversions/{id}/result shows status=completed:
{
"status": true,
"statusCode": 200,
"data": {
"conversionId": "6ad5b5b83729b8fd4c0335e8",
"status": "completed",
"resultUrl": "https://...",
"zipUrl": "https://..."
},
"errors": null
}Current status
- API key generation, listing, and revocation are live for accounts with API access, which FlexFiles turns on by request — see API Keys: Generate, Use, and Revoke.
- The conversion API is live: submit a conversion, poll its status, and fetch the result, covering every conversion tool FlexFiles offers.
- Push-based webhook notifications are live: pass webhookUrl to get a signed callback instead of polling.
- A published, ready-to-install Zapier app built on top of this API is still in progress.
Error handling
FlexFiles API errors use the same envelope as successful responses, with status set to false, an HTTP-matching statusCode, and a human-readable message. A missing or revoked API key returns 401, and a key whose account no longer has API access returns 403. Requesting a conversion type that isn't supported returns 422. Requests are rate-limited per account, at 30 conversion requests a minute (300 an hour) and 120 status or result requests a minute (1,200 an hour); going over returns 429.
Common reference questions
Can I call the conversion endpoints right now?
Yes, once your account has API access, which FlexFiles turns on by request. Then generate an API key from Account settings and call POST /api/v1/conversions — every FlexFiles conversion tool is supported.
Which conversions does the API support?
All of them — the same catalog available on the website, from PDF/image conversions to merging, compressing, protecting, OCR, and more. See the full list above.
Can I get notified when a conversion finishes, instead of polling?
Yes. Pass an optional webhookUrl field (must be https://) when you create a conversion, and FlexFiles POSTs a notification to it once the conversion completes or fails -- no need to poll. The notification is intentionally thin ({event, eventId, conversionId, status, timestamp}, no download link) -- call GET /api/v1/conversions/{id}/result with your API key to fetch the actual result once notified.
How do I verify a webhook notification really came from FlexFiles?
Every delivery carries an X-FlexFiles-Signature header (t=<timestamp>,v1=<hmac>) computed with HMAC-SHA256 over "{timestamp}.{raw body}", using the signing secret shown once when you generated your API key. Recompute the same HMAC and compare it to v1 using a constant-time comparison before trusting the payload.