Skip to main content

PDF Tools API

A REST API for Falcon PDF's processing tools — merge, compress, convert, OCR and more. Upload a file, run an operation, download the result. Enterprise access is credit-billed and authenticated with an API key.

Base URL: https://api.falconpdf.com

:::info Getting a key API keys are issued per enterprise client. Create one from your Falcon PDF account's developer settings. The full key is shown once and cannot be recovered — only rotated. :::

Authentication​

Send your API key as a Bearer token. Keys have the form fpk_live_<id>.<secret>.

Authorization: Bearer fpk_live_<id>.<secret>

Keep the secret server-side. Enterprise requests are not subject to the browser rate limits or human verification used on the free web tools.

Credits & billing​

  • Each submitted job costs 1 credit, debited when the job is accepted.
  • The debit happens whether the job later succeeds or fails. There are no refunds.
  • The remaining balance is returned in the response body as credits_remaining and in the X-Credits-Remaining response header.
  • When you run out, the API returns 402 Payment Required.

Request flow​

Processing is asynchronous: submit a job, poll its status, then download the result.

  1. Submit a multipart upload to POST /api/upload/ → get a job_id.
  2. Poll GET /api/status/{job_id}/ until finished or failed.
  3. Download from GET /api/download/{job_id}/.
note

Results are available for a limited time (about one hour) after completion.

Endpoints​

POST /api/upload/​

Multipart form. Fields: file (plus file2, file3… for multi-file tools like merge), operation, and an optional params JSON string. Max 100 MB per file.

curl -X POST https://api.falconpdf.com/api/upload/ \
-H "Authorization: Bearer fpk_live_<id>.<secret>" \
-F operation=compress \
-F 'params={"quality":"ebook"}' \
-F file=@document.pdf
{
"job_id": "7b1e...",
"status": "queued",
"queue": "pdf-jobs-paid",
"credits_remaining": 4821,
"rate_per_minute": 60
}

GET /api/status/{job_id}/​

curl https://api.falconpdf.com/api/status/7b1e.../ \
-H "Authorization: Bearer fpk_live_<id>.<secret>"
// while running
{ "job_id": "7b1e...", "status": "queued", "result": null }

// when done
{ "job_id": "7b1e...", "status": "finished", "result": { "status": "completed" } }

// on a processing error
{ "job_id": "7b1e...", "status": "failed", "result": { "status": "failed", "error": "..." } }

Status values: queued, started, finished, failed, canceled. A password-protected input comes back as failed with a password_required_files list — resubmit the password via /api/update/.

GET /api/download/{job_id}/​

Returns the result file (a 302 redirect to a short-lived signed URL). Call it only once status is finished.

curl -L -o result.pdf https://api.falconpdf.com/api/download/7b1e.../ \
-H "Authorization: Bearer fpk_live_<id>.<secret>"

POST /api/update/{job_id}/​

Retry a failed job with new parameters — e.g. supply a password for a protected PDF. JSON body. Does not cost an additional credit.

curl -X POST https://api.falconpdf.com/api/update/7b1e.../ \
-H "Authorization: Bearer fpk_live_<id>.<secret>" \
-H "Content-Type: application/json" \
-d '{"password":"s3cr3t"}'

POST /api/cancel/{job_id}/​

Cancel a queued or running job.

Operations​

Pass one of these as operation. The params JSON is operation-specific (e.g. {"quality":"ebook"} for compress, {"pages":"1-3"} for split).

operationinputdescription
mergePDFsCombine multiple PDFs into one
splitPDFSplit into pages / ranges (ZIP)
extractPDFExtract a page range
rotatePDFRotate pages
deletePDFRemove pages
organizePDFReorder pages
compressPDFReduce file size
unlockPDFRemove a known password
protectPDFAdd a password
flattenPDFFlatten form fields
watermarkPDFAdd a text watermark
redactPDFBlack out regions
numberPDFAdd page numbers
cropPDFCrop pages
ocrPDFAdd a searchable text layer
pdf_to_imagesPDFRender pages to PNG/JPG (ZIP)
pdf_to_docPDFConvert to DOCX
pdf_to_excelPDFExtract tables to XLSX
pdf_to_pptPDFConvert to PPTX
pdf_to_htmlPDFConvert to HTML
pdf_to_textPDFExtract text
pdf_to_pdfaPDFConvert to PDF/A
word_to_pdfDOC/DOCX/ODT/RTF…Office document to PDF
excel_to_pdfXLS/XLSX/CSV…Spreadsheet to PDF
ppt_to_pdfPPT/PPTX…Presentation to PDF
webpage_to_pdfHTML / URLRender a page to PDF
images_to_pdfJPG/PNG…Combine images into a PDF

Errors​

statusmeaning
400Bad request — missing file, unsupported operation or file type, invalid params
402Out of API credits (top up to continue)
403Invalid or inactive API key
404Job or result not found
409Job already started
413File exceeds the 100 MB limit
503Could not queue the job — retry

End-to-end example​

# 1. submit
JOB=$(curl -s -X POST https://api.falconpdf.com/api/upload/ \
-H "Authorization: Bearer $FALCON_API_KEY" \
-F operation=pdf_to_doc -F 'params={}' -F file=@report.pdf \
| jq -r .job_id)

# 2. poll
until curl -s https://api.falconpdf.com/api/status/$JOB/ \
-H "Authorization: Bearer $FALCON_API_KEY" | jq -e '.status=="finished"'; do
sleep 2
done

# 3. download
curl -L -o report.docx https://api.falconpdf.com/api/download/$JOB/ \
-H "Authorization: Bearer $FALCON_API_KEY"