Fax API: How to Send Faxes Programmatically (2026)

A fax API lets developers send and receive faxes through simple REST calls — no fax machine, no phone line, no protocol knowledge. Learn how the mFax API and other fax APIs work, compare providers and pricing, and integrate faxing into your app.

Fax API: How to Send Faxes Programmatically (2026)

By Alexey Spasskiy · Published March 22, 2026 · Updated June 8, 2026 · 14 min read

Quick Answer: A fax API lets you send and receive faxes through simple REST calls — no fax machine, no phone line, no protocol knowledge. Upload a document, provide a phone number, and your code handles the rest. The mFax API sends a fax with a single multipart POST /v1/faxes request, and mFax Business includes API access with HIPAA compliance starting at about $9/mo (billed annually).


Fax is still deeply embedded in healthcare, legal, finance, and government workflows. Over 9 billion fax pages are exchanged annually in US healthcare alone, and 89% of organizations continue using fax for critical document transmission. But nobody wants to manage physical fax machines — especially developers building modern software.

A fax API bridges the gap. It lets your application send and receive faxes programmatically through standard HTTP requests, while the provider handles the analog telephony, protocol negotiation, and delivery confirmation behind the scenes.

This guide covers how fax APIs work, what features to evaluate, how leading providers compare on pricing, and how to integrate fax into your application step by step — with working examples from the first-party mFax API (built by Octagon Lab) and honest comparisons to the other major providers.


What Is a Fax API?

A fax API is a set of REST endpoints that lets software send, receive, and manage faxes programmatically. Instead of feeding paper into a machine connected to a phone line, your application makes an HTTP POST request with a document attachment and a recipient phone number. The provider's cloud infrastructure converts the document, establishes a telephone connection, and transmits it as a fax.

How it differs from online fax services: A web-based fax service gives people a dashboard to send faxes manually. A fax API gives software the ability to send faxes automatically — triggered by events in your application (a form submission, a CRM action, an EHR workflow).

Core capabilities of a fax API:

  • Send faxes — POST a document with a destination number
  • Receive faxes — get incoming faxes delivered to a webhook endpoint as PDFs
  • Track status — poll or subscribe to delivery confirmations and error notifications
  • Manage records — list, fetch, and delete sent and received faxes through the API
  • Store and retrieve — download sent and received fax documents from the provider's storage

Fax API vs. Email-to-Fax

Many cloud fax services also offer email-to-fax, where you send an email to a special address (like 15551234567@provider.com) and it's delivered as a fax. A fax API does the same thing but through structured HTTP requests — giving you error handling, status callbacks, and full programmatic control. See our email-to-fax guide for the non-API approach.


How a Fax API Works

The lifecycle of a fax sent through an API follows five stages. The pattern is the same across providers; the concrete examples below use the mFax API.

1

Authenticate

Your application sends an API key or OAuth token with every request. Most providers use bearer tokens generated from a dashboard. With mFax you create a business API key in the dashboard and send it as Authorization: Bearer zk_live_.... It's a server-side secret — never ship it in a browser or mobile app.

2

Send the request

Make a POST request to the send endpoint. For mFax that's POST /v1/faxes as multipart/form-data with two fields: to (the recipient's fax number in E.164) and file (a PDF). Fax systems ultimately transmit a rasterized image of each page, so the provider handles the conversion to the native fax format server-side.

3

Provider transmits the fax

The provider's telephony infrastructure dials the recipient's fax number, negotiates the T.38 fax-over-IP protocol (or routes through the PSTN), and transmits the document page by page. This takes 30–60 seconds per page on average. The fax moves through the lifecycle queued → sending → delivered (or failed).

4

Delivery confirmation

The provider notifies you of the result. mFax POSTs a webhook event (fax.delivered or fax.failed) to the URL you configure in the dashboard, and you can also poll GET /v1/faxes/{uuid} using the UUID returned in step 2.

5

Receive inbound faxes

When someone sends a fax to your virtual number, the provider converts the incoming signal to a PDF. mFax fires a fax.received webhook and exposes the document via GET /v1/faxes?direction=inbound; the media_url on the Fax object is a presigned, time-limited download link. Your application stores it, routes it, or triggers a workflow.

Retry Logic Varies by Provider

Some providers automatically retry failed transmissions (3–6 attempts over 15–30 minutes). Others — like Telnyx — do not auto-retry, leaving it to your application to implement retry logic. mFax surfaces a failure_reason (e.g. user_busy) on failed faxes so you can decide whether to resend. Check your provider's documentation before going to production.


Why Use a Fax API?

If your application needs to send or receive faxes, here's why an API is the right approach:

⚡

Automate Workflows

Trigger faxes from events in your application — a patient signs a consent form, a contract gets approved, a claim is filed. No manual intervention required.

📈

Scale Effortlessly

Send 10 or 10,000 faxes per day through the same API. No hardware to add, no phone lines to provision. The provider's infrastructure scales for you.

🛡

HIPAA Compliance

Healthcare applications must transmit PHI securely. Fax APIs with TLS encryption, AES-256 at rest, signed BAAs, and audit logging meet HIPAA requirements. mFax Business includes a signed BAA — see our HIPAA fax API guide.

👁

Full Visibility

Delivery confirmations, error codes, page counts, and transmission timestamps — all returned in structured JSON. Compare that to a fax machine's thermal printout.

☁

No Infrastructure

No fax server to maintain. No phone lines to rent. No modem firmware to update. The API provider handles uptime, redundancy, and carrier relationships.

🌎

Global Reach

Send faxes to 150+ countries through a single API endpoint. The provider manages international dialing codes and carrier routing.


Fax API Providers Compared (2026)

Choosing a fax API provider comes down to pricing, compliance, SDK support, and reliability. Here's how the major players compare:

ProviderPricing ModelPer-Page CostHIPAA/BAASDKs
mFaxBusiness subscriptionIncluded in plan (from $9/mo)Yes (BAA included)REST API (Bearer zk_live_ key)
TelnyxPay-per-page$0.007/pageYes (BAA available)REST, Python, Ruby, Node
RingCentralBundled plansIncluded (750–3000pp)Yes11 languages
Sinch (Phaxio)Pay-per-page$0.045/pageYes (BAA available)REST, PHP, Ruby, Python

mFax

The mFax API is a first-party REST API from Octagon Lab. Authentication is a single Authorization: Bearer zk_live_... header using a business API key created in the mFax dashboard. Sending is one multipart/form-data request to POST /v1/faxes with just to and file — no connection IDs or per-request configuration to wire up. The sender number is your mFax Business virtual fax number, tied to your subscription. Webhooks (fax.delivered, fax.failed, fax.received) are configured once in the dashboard with an optional signing secret. API access, a virtual fax number, HIPAA compliance with a signed BAA, team accounts, and a web dashboard all come with mFax Business from about $9/mo. Pricing is fully customizable — you build your own plan with a live calculator, picking the exact seats and pages your integration needs and paying only for what you use instead of buying a rigid fixed tier. Read the docs and create a key at developers.mfax.to.

Best for: teams that need both a user-facing dashboard and an API — healthcare practices, legal firms, and SMBs that want a single platform for manual and automated faxing.

Telnyx

The developer favorite for raw API flexibility. Telnyx uses a Bearer token, charges around $0.007 per page with no monthly minimums, and provides SDKs for Python, Ruby, and Node.js. It exposes a hosted media_url and requires a connection_id on send, and its webhooks are Ed25519-signed. The catch: no auto-retry on failed sends, so your code needs to handle retries. Telnyx signs a BAA for HIPAA workloads.

Best for: developers building high-volume integrations who want granular control and the lowest per-page cost.

RingCentral

Part of a larger communications platform (voice, SMS, video). The fax API uses OAuth 2.0 / JWT, supports many file formats and 11 SDK languages, and includes a sandbox environment with free test faxes. Plans bundle fax pages with your seat subscription.

Best for: enterprises already using RingCentral for unified communications who want to add fax to the same platform.

Sinch (formerly Phaxio)

Phaxio was one of the earliest developer-focused fax APIs, now part of Sinch. It uses HTTP Basic auth (API_KEY:API_SECRET) and a multipart file upload. At around $0.045/page, it's pricier than Telnyx but offers automatic retries, a configurable no-retention mode, and a free signed BAA.

Best for: startups and small integrations that prioritize simplicity and don't need enterprise features.

Twilio Fax Is Gone

Twilio fully sunset its Programmable Fax — both send and receive — on December 17, 2021. There is no current Twilio fax API. If you're migrating from Twilio Fax, mFax and Telnyx are the common landing spots; Sinch is another developer-friendly option. (Note: Humble Fax does not sign a BAA, so it isn't suitable for PHI.)


Key Features to Evaluate

Not all fax APIs are equal. Here's what matters when choosing a provider:

FeatureWhy It Matters
REST architectureStandard HTTP methods and JSON responses integrate cleanly with any language or framework. The mFax API is JSON everywhere except the multipart send endpoint.
Webhook callbacksReal-time delivery notifications eliminate the need to poll for status updates. mFax sends fax.delivered, fax.failed, and fax.received events.
File format supportPDF and TIFF are standard; some providers also accept DOCX, XLSX, and HTML. The mFax send endpoint takes a PDF.
Max file sizeRanges widely across providers — check the limit against your typical document sizes.
Inbound faxingReceiving on a virtual number. mFax delivers inbound faxes via the fax.received webhook and GET /v1/faxes?direction=inbound.
Number portingTransfer existing fax numbers without changing what clients dial.
Auto-retryAutomatic retries on busy signals and no-answer save you from building retry logic. Some providers (Sinch) auto-retry; others (Telnyx) don't.
Sandbox/testingSome providers (RingCentral) offer a sandbox with free test faxes to validate integration without sending real ones.
Detailed error codesSpecific error responses enable intelligent retry strategies. mFax returns a JSON { code, message } with codes like invalid_number and quota_exceeded.
Compliance (HIPAA/BAA)Non-negotiable for healthcare. Verify the provider signs an actual BAA, not just marketing claims.

Integrating a Fax API: Step by Step

Here's the typical integration workflow regardless of which provider you choose:

1

Get API credentials

Sign up with your chosen provider and generate API keys from the developer dashboard. For mFax, create a business API key in the dashboard (it starts with zk_live_) and keep it server-side. Read the reference at developers.mfax.to.

2

Confirm your fax number

Your outbound faxes are sent from a virtual fax number. With mFax that number is tied to your Business subscription, so there's no per-request from field — the sender is your organization's number, and the same number receives inbound faxes.

3

Configure webhooks

Register your webhook URL (and an optional signing secret) in the provider dashboard. mFax POSTs three event types — fax.delivered, fax.failed, and fax.received — to that single URL, rather than per request.

4

Send your first fax

Make a POST request with the document file and recipient number. The mFax response is HTTP 202 Accepted with a Fax object containing a uuid for tracking. Start with a number you control so you can verify end-to-end before going to production.

5

Handle delivery callbacks

Your webhook endpoint receives a JSON payload with the transmission result. Log the status, update your database, and trigger any downstream workflows (notify the user, retry on failure, archive on success). Dedupe on the event id — mFax delivery is at-least-once.

6

Process inbound faxes

When a fax arrives on your virtual number, the provider sends a webhook with a link to the document. For mFax, the fax.received event carries a Fax object whose media_url is a presigned, time-limited URL. Parse the payload, store the document, and route it to the right user or system.

Quick Start: Send and Poll with the mFax API

The fastest way to see the mFax API work is two curl calls. Send a PDF, then fetch the fax by the uuid you got back:

# 1. Send a fax (multipart: just `to` and `file`)
curl -X POST https://developers.mfax.to/v1/faxes \
  -H "Authorization: Bearer zk_live_your_key" \
  -F "to=+15417543010" \
  -F "[email protected]"

# 2. Poll the fax by its UUID for status updates
curl https://developers.mfax.to/v1/faxes/<uuid> \
  -H "Authorization: Bearer zk_live_your_key"

That's the whole send path: no from, no quality, no per-request callback URL. The hands-on walkthrough with Node, Python, and PHP examples lives in our send fax API tutorial.

Typical API Request Structure

Here's the real mFax send request. It's a multipart/form-data POST with exactly two fields — to (E.164) and file (a PDF):

POST /v1/faxes HTTP/1.1
Host: developers.mfax.to
Authorization: Bearer zk_live_xxxxxxxx
Content-Type: multipart/form-data; boundary=----mfax

------mfax
Content-Disposition: form-data; name="to"

+15417543010
------mfax
Content-Disposition: form-data; name="file"; filename="invoice.pdf"
Content-Type: application/pdf

<binary PDF data>
------mfax--

A successful send returns HTTP 202 Accepted with the Fax object:

{
  "uuid": "a1b2c3d4-5e6f-7081-92a3-b4c5d6e7f809",
  "status": "queued",
  "direction": "outbound",
  "to": "+15417543010",
  "page_count": 0,
  "created_at": "2026-06-05T14:30:00Z"
}

The fax then moves queued → sending → delivered (or failed). You learn the outcome either from the fax.delivered / fax.failed webhook or by polling GET /v1/faxes/{uuid}, which returns the current status, the final page_count, and a presigned media_url to download the PDF. On a failed fax, failure_reason carries the carrier reason (for example, user_busy).

Other providers, same shape

The mFax request above maps cleanly to other APIs, but the details differ: Telnyx requires a connection_id and uses a hosted media_url, Sinch/Phaxio authenticates with HTTP Basic (API_KEY:API_SECRET), and RingCentral uses OAuth 2.0 / JWT. Always check the provider's reference before copying field names.


HIPAA Compliance for Fax APIs

If your application handles Protected Health Information (PHI) — patient records, prescriptions, referrals, lab results — your fax API must be HIPAA compliant. This isn't optional. The largest HIPAA fax violation resulted in a $2.5 million fine.

Here's the compliance checklist:

  • ✓Signed BAA: The provider must execute a Business Associate Agreement before you transmit any PHI. Marketing that says "HIPAA-capable" or "HIPAA-ready" is not the same as a signed BAA. mFax Business and Telnyx both sign one; Humble Fax does not, so it's off the table for PHI.
  • ✓TLS 1.2+ in transit: All API calls and webhook callbacks must use HTTPS with TLS 1.2 or higher. Reject any provider that allows unencrypted connections.
  • ✓AES-256 at rest: Fax documents stored on the provider's servers must be encrypted with AES-256. Check how long documents are retained and whether you can configure auto-deletion. See our fax encryption guide for details.
  • ✓Audit logging: Every send, receive, view, and download event must be logged with timestamps, user IDs, and IP addresses. These logs must be exportable for compliance audits.
  • ✓Access controls: Role-based access so only authorized users can view faxes. Multi-factor authentication on API dashboard access.
  • ✓Secure webhooks: Webhook payloads should be signed so your application can verify they genuinely came from the provider. mFax signs with an HMAC-SHA256 over "<timestamp>.<raw_body>" and sends it in the X-Zelda-Timestamp and X-Zelda-Signature headers; verify in constant time and reject timestamps older than 5 minutes.

For the full framework, see our HIPAA fax API guide and our list of HIPAA compliant fax services.

BAA First, Integration Second

Never transmit PHI through a fax API until the BAA is signed and countersigned. Get the paperwork done during the evaluation phase — before you write a single line of integration code.


Common Use Cases

Fax APIs power automated workflows across industries where fax remains the required transmission method:

Healthcare (EHR integration) — Automatically fax referrals, prior authorizations, prescriptions, and lab results from your EHR system. Over 70% of healthcare communication still uses fax, and 56% of medical referrals are fax-based. Integrating a fax API eliminates the manual print-scan-fax cycle. See our guide on faxing medical records.

Legal (document filing) — Courts in many jurisdictions require faxed filings. A fax API lets case management software send filings automatically with delivery confirmation that holds up as proof of service.

Finance and insurance — Loan documents, claims, and compliance paperwork are routinely faxed between institutions. API integration eliminates manual handling and creates an auditable paper trail.

Government (IRS and agencies) — The IRS accepts faxed forms for dozens of submissions. A fax API can automate IRS form delivery from tax preparation software.

Enterprise IT — Replace aging fax servers and phone lines with a cloud API. Companies switching from on-premise to cloud fax report 50–70% cost savings on faxing infrastructure.


Fax API vs. Other Fax Methods

Fax APICloud Fax DashboardEmail-to-FaxPhysical Fax Machine
Who uses itDevelopers, softwareOffice staffAnyone with emailAnyone physically present
AutomationFull programmatic controlManual (point-and-click)Semi-automatedNone
Volume handlingUnlimited (scales with API)Limited by manual effortModerateSingle fax at a time
Delivery trackingStructured JSON callbacksDashboard/email alertsEmail repliesThermal printout
ComplianceHIPAA-ready (with BAA)Depends on serviceDepends on serviceNo encryption
Cost per page$0.007–$0.045 (Telnyx to Sinch)$0.10–$0.50Included in plan$0.05 + supplies + phone line
Best forAutomated workflowsOccasional manual faxingSimple one-off sendsLow-tech environments

For most businesses that fax occasionally, a cloud fax dashboard is sufficient. For applications that need to send faxes as part of an automated workflow, an API is the only option that scales.


Common API Errors and How to Handle Them

Fax transmission can fail for reasons outside your control. Build your integration to handle these gracefully. The mFax API returns a JSON error body — { "code": "...", "message": "..." } — alongside the HTTP status:

ErrorCauseRecommended Action
invalid_number (400)Recipient number isn't valid E.164Validate and normalize numbers before sending
quota_exceeded (402)Plan send quota reachedUpgrade the plan or wait for the quota window to reset
subscription_inactive (403)Billing/subscription lapsedResolve billing before retrying
rate_limited (429)Too many requests for your keyHonor the Retry-After header; back off with jitter and retry
failed fax + failure_reasonCarrier-level failure (e.g. user_busy)Inspect failure_reason and decide whether to resend
Auth errorInvalid or expired API keyRotate the zk_live_ key; confirm it's set server-side only

Respect Rate Limits and Back Off

mFax uses a per-key token bucket. On a 429 you get a Retry-After header (seconds) plus RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset. For transient carrier failures, use exponential backoff with jitter and cap your retries. Log every attempt so you can diagnose patterns — a number that always returns user_busy may be disconnected.


Frequently Asked Questions

What programming languages can I use with a fax API?

Any language that can make HTTP requests — which is all of them. Most fax APIs are RESTful, returning JSON over HTTPS. The mFax API has no official SDK packages, but because it's a plain REST API you can call it from Node, Python, PHP, Go, or anything else with an HTTP client. Some providers do ship SDKs (RingCentral offers 11 languages, Telnyx offers Python/Ruby/Node), but they're never required.

Can I send a fax to an international number via API?

Yes. Format the number in E.164 format (e.g., +442071234567 for a UK number) and the provider routes it through international carriers. International per-page rates are typically higher than domestic. See our international faxing guide for country-specific formatting.

How fast is fax transmission via API?

A single page takes approximately 30–60 seconds to transmit, the same as a physical fax machine — the bottleneck is the analog telephone protocol, not your API call. A 10-page document takes 5–10 minutes end-to-end. The API call itself returns in milliseconds: mFax responds 202 Accepted immediately and queues the fax, so you track progress via webhook or GET /v1/faxes/{uuid}. See our fax transmission time guide for details.

Can I receive faxes through an API?

Yes. With mFax, inbound faxes arrive on your Business virtual fax number: the API fires a fax.received webhook and the document is also available via GET /v1/faxes?direction=inbound. The Fax object's media_url is a presigned, time-limited link to the PDF. If webhooks aren't feasible, you can poll the list endpoint instead.


Get Started with a Fax API

A fax API turns a 1960s communication protocol into a modern, programmable service. Whether you're building an EHR integration, automating legal filings, or replacing aging fax servers, the right API provider handles the telephony so you can focus on your application logic.

For developers, the mFax API gets you sending in minutes: create a zk_live_ key, POST /v1/faxes with a to number and a PDF, and track delivery with webhooks. Read the reference and grab a key at developers.mfax.to, then follow our send fax API tutorial for working code and the HIPAA fax API guide for compliant setups.

For business teams that need both a user-facing dashboard and API access, mFax Business includes everything: API access, virtual fax numbers, HIPAA compliance with a signed BAA, team accounts, and a web dashboard — starting at about $9/mo. You build your own plan, scaling seats and pages to fit your workload with no fixed tiers.

For personal or occasional faxing without an API, the mFax app lets you send a fax from your phone in under 2 minutes.

For a broader look at cloud fax services, see our cloud fax guide or our comparison of the best online fax services.

Frequently Asked Questions

What is a fax API?
A fax API is a set of REST endpoints that lets your application send and receive faxes programmatically. You make an HTTP request with a document and a phone number, and the provider's infrastructure handles the analog transmission. No fax machine or phone line required. See our [cloud fax guide](/blog/cloud-fax/) for how the underlying technology works.
How do I send a fax with the mFax API?
Create a business API key in the mFax dashboard, then POST a multipart request to https://developers.mfax.to/v1/faxes with an Authorization: Bearer header and two fields — `to` (the recipient in E.164) and `file` (your PDF). mFax returns HTTP 202 with a Fax object you can poll with GET /v1/faxes/{uuid}. Full docs and keys are at developers.mfax.to.
Is a fax API HIPAA compliant?
It can be — if the provider offers TLS 1.2+ encryption, AES-256 at rest, a signed Business Associate Agreement (BAA), and audit logging. Not every fax API qualifies. mFax Business includes a signed BAA and API access from about $9/mo. See our [HIPAA fax API guide](/blog/hipaa-fax-api/) for the full checklist.
Does Twilio still have a fax API?
Twilio fully sunset its Programmable Fax (send and receive) on December 17, 2021. Alternatives like mFax, Telnyx, and Sinch offer complete fax API solutions in 2026, and mFax and Telnyx are common landing spots for ex-Twilio Fax users.
What file format does the mFax API accept?
The mFax send endpoint takes a PDF uploaded as the `file` field in a multipart/form-data request. Many fax APIs also accept DOC/DOCX, TIFF, and image formats and convert them server-side, but for mFax send a PDF.
Home Business Pricing Fax API Blog Document Converter Company
Terms of Service Privacy Policy