# How to block SPAM contacts in Inbox

The following article will explain in steps how to deflect spam-like contacts and Inbox.

#### Before getting started <a href="#id-01gb7xmjj32c565655jm26nhs9" id="id-01gb7xmjj32c565655jm26nhs9"></a>

You will need:

* A [MessageBird account](https://dashboard.messagebird.com/)
* An active [Inbox](https://inbox.messagebird.com/) instance

#### Blocking a spam contact <a href="#id-01gb7xm89b2tvc3yenjf5zkbzr" id="id-01gb7xm89b2tvc3yenjf5zkbzr"></a>

If you notice a SPAM contact you would like to deflect from reaching you further, do the following:

**1)** Add a custom attribute to the spamming [Inbox](https://inbox.messagebird.com/contacts) contact of SPAM:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-4000f3d2f5147f16545dd9ead0506ae0194f5117%2FInbox_spam.gif?alt=media" alt=""><figcaption></figcaption></figure>

If you would like to mark a bulk of contacts as SPAM, you are able to do so by using the [Import contact](https://inbox.messagebird.com/contacts/import) feature.

**2)** Visit your Inbox Flow in [Flow Builder](https://dashboard.messagebird.com/en/flow-builder) and add a *Branch* step that will fetch such contacts:

&#x20;

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-8dae78deda8f49f2d81fb84f464928d5ae197545%2F5a97e1f7-ffb4-48eb-9f16-c39b5319e2cf.png?alt=media" alt=""><figcaption></figcaption></figure>

* * Choose *New Branch* with a *custom condition*:

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-ec4e2ae31c94b61fceb49179d20d0a1b68f5d9b9%2Fmceclip0.png?alt=media" alt=""><figcaption></figcaption></figure>

* * Set the *custom variable* to *contact.attributes.SPAM* by using two curly brackets on your keyboard **{{** to initiate the variable loading

<figure><img src="https://675349995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUJNEE9TMK4fU91VKstBr%2Fuploads%2Fgit-blob-cd7e50fb16af9220762f6bf3154929b812e0a8ae%2FVariable_.jpg?alt=media" alt=""><figcaption></figcaption></figure>

* * and choose the *custom condition* of *is empty or not set*
  * The Flow will now check if the contact has a custom attribute of SPAM
    * If it does not, it will continue the Flow to the following steps.
    * If it **does have the attribute SPAM**, the Flow will be ended, preventing the contact from reaching your Inbox.

⚠️ If at any point you would like to remove the contact as SPAM, do the following:

* Remove the custom attribute of *SPAM* set on the contact in [Inbox](https://inbox.messagebird.com/contacts). By doing so, the contact will no longer be caught in the *Branch* step set in Flow Builder.

You can build up your Flow based on the simple example at the end of this article. Upload the JSON file in your Flow Builder and modify it to your use case.

&#x20;

📤  Feel free to [contact our Support](https://support.messagebird.com/hc/en-us/requests/new) in case you might need some help!
