Learn how to send a fax via API with copy-paste code examples in cURL, Node.js, Python, and PHP. We cover authentication, the send request, status webhooks, and error handling — everything you need to send your first fax programmatically.
Frequently Asked Questions
How do I send a fax through an API?
Make an authenticated HTTP POST request to your provider's `/faxes` endpoint with three things: the recipient number (`to`), your fax number (`from`), and the document (as a file upload or a hosted URL). The API returns a fax ID you can use to track delivery. See the [code examples](#step-2-send-your-first-fax) above for cURL, Node.js, Python, and PHP.
Can I send a fax from the command line with cURL?
Yes. A single `curl` command with your API key, the recipient number, and a file path sends a fax in seconds — no SDK required. It's the fastest way to test a fax API before writing application code.
How much does it cost to send a fax via API?
Pay-as-you-go fax APIs run roughly $0.007 to $0.05 per page, plus about $1–$2/mo for a dedicated fax number. Subscription plans with API access and HIPAA features start around $20.99/mo. See our [fax API guide](/blog/fax-api/) for a full provider price comparison.
Can I send a fax via API without a fax machine or phone line?
Yes. A fax API runs entirely in the cloud — the provider operates the fax infrastructure and converts your document to the fax format, so you never need a machine, modem, or landline. You only need an internet connection and an API key.
Does Twilio still have a fax API?
No. Twilio sunset its Programmable Fax product on December 17, 2021, and no longer offers send or receive fax endpoints. Developers have migrated to alternatives like mFax, Telnyx, and Sinch.