How Can I Stop Receiving or Block Incoming Faxes

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.

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:

  1. Login to your account at www.twilio.com/console.
  2. Click Runtime from the left-side navigation bar.
    NOTE: If Runtime is not visible, you may first need to click All Products & Services.
  3. Click TwiML Bins, and then select Create New TwiML Bin, or the red plus + sign button.
  4. 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>
  5. 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 blacklist" 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):

  1. Login to your account at www.twilio.com/console.
  2. Click Runtime from the left-side navigation bar.
    NOTE: If Runtime is not visible, you may first need to click All Products & Services.
  3. Click Functions, and then select Create a Function, or the red plus + sign button.
  4. Select the Blank template, and then click Create.
  5. 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 blacklist”.
    • 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 blacklist = event.blacklist ||[ "+12125551234", "+17025556789" ];
      let blocked = true;
      if (blacklist.length > 0) {
      if (blacklist.indexOf(event.From) === -1) {
      blocked = false;
      }
      }
      if (blocked) {
      callback(null, "<Response><Reject /></Response>");
      }
      else {
      callback(null, "<Response><Receive /></Response>");
      }
      };
  6. Configure this Function on your Twilio number by following the steps here: Configuring Phone Numbers to Receive Faxes.
Have more questions? Submit a request
Powered by Zendesk