Notice: Twilio Programmable Fax will be disabled for all users on December 17, 2021. New and inactive accounts will lose access as of December 17, 2020. For full details, including migration options, see Fax Support on Twilio.
All Twilio phone numbers go through a testing process before they're made available for purchase. Unfortunately, some unwanted incoming contacts may continue to reach your Twilio line. Here are some tips to help prevent these contacts from becoming a problem.
Notice: Receiving incoming faxes is generally available for Japanese phone numbers only. Inbound faxes to non-Japanese phone numbers are still considered beta, with no current plans for general availability. Support requests for beta and pre-release products are generally handled by our engineering team, and as such, response times are not guaranteed. For more information on Support limitations for beta and pre-release products, please see Twilio Beta Product Support.
Block all incoming faxes
If you do not want to receive any incoming faxes on your Twilio phone number, you can configure your number to receive Twilio Voice calls, or use a blank Fax Webhook URL. With either of these options, your phone number will be considered 'out of service' for inbound faxes. You will not be charged for any incoming faxes that are blocked in this manner, nor will these connection attempts be received and logged in your project.
Steps for submitting a blank Fax Webhook URL on your on your Twilio number can be found here: Configuring Phone Numbers to Receive Faxes.
Reject and track all incoming faxes
You can achieve similar results by responding to incoming faxes with the <Reject>
TwiML verb. The results are similar to what you would find by using a blank Fax Webhook URL, except that all incoming connection attempts will now be logged by Twilio with the status Cancelled. We do not charge you for rejecting incoming
The easiest way to do this is with a TwiML Bin. Here are the instructions:
- Access the TwiML Bins page in Console.
- Click Create New TwiML Bin, or the red plus + sign button.
- Add a FRIENDLY NAME and some TWIML, and then click Create.
- FRIENDLY NAME: This is up to you - we suggest using something that gives an idea of what the TwiML Bin will do like “Reject Faxes”.
- TWIML: For the code, you will use the <Reject> verb. Your code should look something like this:
<Response> <Reject /> </Response>
- Configure this TwiML bin on your Twilio number by following the steps here: Configuring Phone Numbers to Receive Faxes.
Reject specific faxers
To reject faxes coming from specific numbers, you can create a "virtual block list" with a few lines of code. This will respond to any unwanted fax senders you list with the <Reject>
TwiML verb, and then receive faxes from other numbers as normal. Here are some instructions along with example code for use with Twilio Functions (Beta):
- Access the Functions (Classic) page in Console.
- Click Create a Function, or the red plus + sign button.
- Select the Blank template, and then click Create.
- Add a PATH and update the CODE field, and then click Save.
- PATH: This is up to you - we select using something that gives an idea of what the Function will do like “fax block list”.
- CODE: In this field, copy and paste the code below. Be sure to update line 2 with the phone numbers you want to block faxes from ("+12125551234", "+17025556789").
exports.handler = function(context, event, callback) {
let faxBlock = event.block ||[ "+12125551234", "+17025556789" ];
let blocked = true;
if (faxBlock.length > 0) {
if (faxBlock.indexOf(event.From) === -1) {
blocked = false;
}
}
if (blocked) {
callback(null, "<Response><Reject /></Response>");
}
else {
callback(null, "<Response><Receive /></Response>");
}
}; - Configure this Function on your Twilio number by following the steps here: Configuring Phone Numbers to Receive Faxes.