PDF to URL

Turn a PDF into a public URL for OCR, AI, and document APIs

Invoices, contracts, reports, Drive exports, and webhook PDFs are useful only after another service can fetch them. Upload the PDF, confirm the URL serves `application/pdf`, then pass it into OCR, AI, or document APIs.

Reviewed by
GetFileURL technical team
Updated
PDF OCR URLpdf to URL APIapplication/pdfMistral OCRdelete after OCR
PDF delivery
Header proof
200 OK with Content-Type: application/pdf
Response
url, file_id, content_type, size, expires_at, delete_url
Common flows
invoice OCR, contracts, reports, Drive exports, webhooks
Short answer

What this page answers

Yes. Use the returned url when the OCR API asks for a public PDF URL, and confirm it serves application/pdf before the OCR job starts.

Reviewed by
GetFileURL technical team
Last updated
Handoff

One request in, a URL and JSON out

Request
curl -X POST https://api.getfileurl.com/v1/files \
  -H 'Authorization: Bearer $GETFILEURL_KEY' \
  -F 'file=@invoice.pdf' \
  -F 'visibility=public'
Response
{
  "file_id": "file_8ks41p",
  "url": "https://cdn.getfileurl.com/f/file_8ks41p/invoice.pdf",
  "content_type": "application/pdf",
  "visibility": "public",
  "expires_at": "2026-06-26T10:30:00.000Z"
}
OCR proof

OCR providers need a fetchable PDF response.

The safest PDF-to-URL handoff proves the URL returns PDF bytes before the OCR job starts.

01

Public URL

Use the returned GetFileURL `url` where the OCR API asks for a document URL.

02

Header check

Run `curl -I <returned-url>` and confirm `200 OK` plus `Content-Type: application/pdf`.

03

Base64 fallback

Use Base64 only when the OCR source or automation tool cannot send PDF bytes directly.

Controls

Treat sensitive documents as lifecycle-bound handoffs.

PDF workflows need clear retention behavior. Track expiry, keep the file ID or delete URL, and delete documents after the OCR or processing job finishes.

01

Short retention

Use short expiry windows for one-time OCR, AI review, validation, or document extraction tasks.

02

Delete endpoint

Call delete when OCR confirms the file was fetched and the result is saved.

03

Audit-ready metadata

Keep `url`, `file_id`, `content_type`, `size`, `expires_at`, and OCR job status in workflow logs.

Troubleshooting

Most PDF handoff failures are access or header problems.

PDF processors fetch server-side. They need a reachable URL, the PDF bytes, and a content type the service accepts.

01

Private document link

A link that opens for you in the browser may still fail for OCR or document APIs without your session.

02

HTML instead of PDF

If the source URL returns a viewer page or `text/html`, upload the PDF bytes and use the returned direct URL.

03

Expired before fetch

Confirm `expires_at` leaves enough time for retries, queue delays, and downstream processing.

04

Size or type rejected

Check both the upload limit and the downstream service limit before sending large contracts or reports.

Examples

Copy the same upload shape into code

curl -X POST https://api.getfileurl.com/v1/files \
  -H 'Authorization: Bearer $GETFILEURL_KEY' \
  -F 'file=@invoice.pdf' \
  -F 'visibility=public'

{
  "file_id": "file_8ks41p",
  "url": "https://cdn.getfileurl.com/f/file_8ks41p/invoice.pdf",
  "content_type": "application/pdf",
  "visibility": "public",
  "expires_at": "2026-06-26T10:30:00.000Z"
}
FAQ

Common questions

Can I pass the returned PDF URL to OCR APIs?

Yes. Use the returned `url` when the OCR API asks for a public PDF URL, and confirm it serves `application/pdf` before the OCR job starts.

Does the PDF URL expire?

Expiry should be set to match the workflow. The response includes lifecycle metadata so the caller knows when the URL stops resolving.

How do I remove a PDF after processing?

Store `file_id` or `delete_url` from the upload response and remove public access when OCR or document processing is complete.