# Verify deliverable email addresses with Kickbox

## Introduction[](#introduction)

You don’t just want to know that email addresses are **valid** (i.e. they comply with RFC 5322); you want to know that addresses are **deliverable**. Sending messages to undeliverable email addresses can increase your bounce rate and impact your deliverability.

If you’re not able to verify the deliverability of an email address *before* you add it to Customer.io, you can always leverage Webhook actions and a third-party verification service like [Kickbox](https://kickbox.com?ref=customerio_docs).

This allows you to evaluate the deliverability of the email addresses in your workspace and identify the ones you shouldn’t email.

 This method is provider-agnostic

While we’ll use Kickbox in our example below, you could use any email verification service that has an API.

## Ingredients[](#ingredients)

*   A Data-Driven Segment
*   A Segment-triggered Campaign
*   Basic API and Webhooks knowledge
*   A Kickbox account

## Method[](#method)

We’ll create a Segment-triggered campaign for people who haven’t been verified yet, send an API request to Kickbox to verify their email, and save the result as attributes to leverage that information later.

1.  [Get your Kickbox API key](#kickbox-api-key).
2.  [Create a Segment of unverified emails](#campaign-trigger-segment) (to use as a campaign trigger).
3.  [Create a Segment of verified emails](#campaign-goal-segment) (to use as a campaign goal).
4.  [Create a Campaign with a webhook action to verify people](#create-campaign).

### Get a Kickbox API key[](#kickbox-api-key)

We’ll start by getting a Kickbox API key. You can go to [kickbox.com](https://kickbox.com?ref=customerio_docs) to create an account. Your account will be provisioned with 100 credits (i.e. 100 email addresses to verify) and you can purchase extra credits.

1.  Go to the **Verification** section of the left sidebar and click **API**.
    
    [![The menu of the Verification services with an arrow pointing to API menu item](https://docs.customer.io/images/recipe-kickbox-kickbox-api-menu.png)](#c940375f9757d0bf5337ed84b7d384c3-lightbox)
    
2.  Click **Manage Keys**.
    
    [![The Manage Keys CTA with an arrow pointing to it](https://docs.customer.io/images/recipe-kickbox-kickbox-manage-keys.png)](#b99e5f9d7321d5415ba3771bd036b50c-lightbox)
    
3.  Click to create a new key.
    
    [![The menu of API Keys with an arrow pointing to the create api key button](https://docs.customer.io/images/recipe-kickbox-kicbox-keys-menu.png)](#be0dbe9952a794131e8adf0c204e103a-lightbox)
    
4.  In the modal window, specify a key name (1), activate it for `Production Mode` (2), select the scope of permissions (3) before finally creating it (4).
    
    [![The create API key wizard with numbered hints for the fields to form/check](https://docs.customer.io/images/recipe-kickbox-kickbox-create-key.png)](#50753874fe03cac6d69fb1fee72f1290-lightbox)
    

When this is done, you’ll see your API key in the list and you can click the eye icon to unmask it.

[![The Kickbox API key with the actual key obfuscated and an arrow pointing to the button allowing to hide/display the key](https://docs.customer.io/images/recipe-kickbox-kicbox-api-key-visible.png)](#5cf9fc2d956ce0ab249fb9787c867db8-lightbox)

### Create a Segment to use as a campaign trigger[](#campaign-trigger-segment)

1.  In Customer.io, go to *Segments* and click on **Create Segment**.
    
2.  Give your new segment a *Name* and *Description* then click **Create Data-Driven Segment**.
    
    [![The segment creation form with name and description filled and arrow pointing to Create Data-Driven Segment](https://docs.customer.io/images/recipe-kickbox-create-segment.png)](#216c2b29b399cf9e74982900fa77b0e2-lightbox)
    
3.  Add a single condition for this segment: **Attribute** `email_verified` **is not equal to** `true`. Save the conditions.
    
    [![The segment conditions with the condition highlighted](https://docs.customer.io/images/recipe-kickbox-edit-segment.png)](#7cfddc52702c7eaa4b57e1cd00bba708-lightbox)
    

### Create a Segment to use as a Campaign goal[](#campaign-goal-segment)

Follow the same steps that you used to [create a campaign trigger](#campaign-trigger-segment) create a second segment. Make sure it’s set as “Segment for people where `All` of the following conditions match” and add the following two conditions:

*   **Attribute** `email_verified` **is equal to** `true`
*   **Attribute** `email_verification_result` **does not contain** `undeliverable`

[![The segment we'll use as a Goal and it conditions highlighted](https://docs.customer.io/images/recipe-kickbox-segment-goal.png)](#a2ca338f4cdaf0f253ddd5dc91289fd0-lightbox)

### Create a Campaign in Customer.io[](#create-campaign)

Now that we have our API key and our Segments, we can proceed with our Campaign creation. Head over to Campaigns and click on **Create Campaign**. Click *Untitled Campaign* to add a name and description.

#### Set up a trigger[](#set-up-a-trigger)

A trigger determines who enters your campaign. To set one up, click **Choose trigger** then select **Segment change**. In this example, the campaign should trigger when people enter the segment you made in a previous step.

[![The campaign trigger tab with numbered hints for the trigger conditions](https://docs.customer.io/images/recipe-kickbox-campaign-trigger-1.png)](#51eccd0a5fb365846b3a63a57a198367-lightbox)

#### Set up a webhook[](#set-up-a-webhook)

1.  Drag a **Send and receive data** action from the *Build* menu. You can show/hide the menu by clicking **\+ Build** at the bottom of your workflow.
    
    [![The webhook action in the Build menu with an arrow pointing to it](https://docs.customer.io/images/recipe-kickbox-workflow-add-webhook-1.png)](#9bfec08a709f34165033d4f73991b1e0-lightbox)
    
2.  Click **Add Request**. Configure a request to Kickbox’s API. You can learn more about their API [here](https://docs.kickbox.com/reference/verify-an-email-address).
    
    [![The Webhook request screen with numbered hints of options to change](https://docs.customer.io/images/recipe-kickbox-webhook-setup-request.png)](#2f359af6f5d9e595ab14e6d92b842737-lightbox)
    
    *   (1) Select the `GET` method
    *   (2) Add the API URL: `https://api.kickbox.com/v2/verify?email={{customer.email | url_encode}}&apikey=[your_api_key]`
    *    (3) Use the [`url_encode`](/journeys/liquid-tag-list/#url_encode) filter
        
        We use this Liquid filter to convert URL-unsafe characters in a string into percent-encoded characters.
        
3.  Click **Send test…** (1) to send a test request to the API. If it’s successful, you’ll see a `200 OK` status and the response will have a JSON object.
    
    [![The API response](https://docs.customer.io/images/recipe-kickbox-webhook-setup-test.png)](#39f4f5c57d557107669ec5d1df656ede-lightbox)
    
4.  Now that we have a functional webhook, we can easily save elements from the Response object as attributes for the person. Start by clicking on the **Response** tab (1) and then on **Set up an attribute** (2).
    
    [![The Webhook response screen with numbered hints of where to click](https://docs.customer.io/images/recipe-kickbox-webhook-setup-attribute-1.png)](#39ad00b16486c3fe901c72ad6f7edbcf-lightbox)
    
5.  Add one or more attributes. In our example, we’ll add 3 attributes:
    
    *   `email_verified` that we’ll set to `true`. This lets us know which people had their email verified
    *   `email_verification_result` that we’ll set to `{{response.result}}-{{response.reason}}`. This combines the result of the verification request (*which can be `deliverable`, `risky`, `undeliverable`, or `unknown`*) and the reason behind this result. [Learn more about these values](https://docs.kickbox.com/docs/single-verification-api#the-response).
    *   `email_verification_disposable` that we’ll set to `{{response.disposable}}`. This can either be `true` or `false`. If true, the email address is disposable and shouldn’t be emailed.
    
     You can leverage additional data from the request’s response
    
    We’re limiting to these 3 attributes in our example but you could leverage additional data from the request’s response such as if the email address is from a free service, associated with a role, or if it accepts all incoming messages among other things.
    
    [![The Response screen with the different attributes created and their values](https://docs.customer.io/images/recipe-kickbox-webhook-setup-response-attributes.png)](#752a91ccf2935c012be81c800147879b-lightbox)
    

Now, we can test again and we’ll have a preview of the attributes that will be created.

[![The API response preview, now with the attributes and the values they'd be set with](https://docs.customer.io/images/recipe-kickbox-webhook-setup-test-2.png)](#02d630a8e387c9b4a4899eac8d880f77-lightbox)

#### Save and update action settings[](#save-and-update-action-settings)

Back on your workflow, click the webhook action again and click *Settings*. Change the sending behavior to **Send Automatically** and toggle on *Allow conversion from this webhook*.

[![The campaign workflow in Customer.io with the Webhooks action selected. Arrows pointing to the Sending Behavior and Conversion options](https://docs.customer.io/images/recipe-kickbox-campaign-action-3.png)](#4267b83db624516190d5a34a26245652-lightbox)

#### Define the Goal[](#define-the-goal)

Last, but not least, we can define a **Goal** such that people convert when they **enter** the second segment we created earlier.

[![recipe-kickbox-campaign-goal.png](https://docs.customer.io/images/recipe-kickbox-campaign-goal.png)](#65b90de334859fccaa1f02d06e42e5e6-lightbox)

We’ll also set the **Exit** condition as “People don’t exit early, they will move through the entire workflow.”

[![The campaign exit panel is open on the left hand of a campaign.](https://docs.customer.io/images/recipe-kickbox-campaign-exit.png)](#39dbabe2dc82529f86824121941c8ace-lightbox)

#### Review and start your campaign[](#review-and-start-your-campaign)

If you have any outstanding items, click **Review items** in the top right and complete the steps. Otherswise, click **Start Campaign** to give your campaign a final review.

*   If you’d like to only verify new people, select the **Future additions only** option.
*   If you’d like to verify everyone, select the **Current people and future addtions** option.

[![The overview of the campaign setup](https://docs.customer.io/images/recipe-kickbox-campaign-review-1.png)](#014ced2ff364e640dacd6e4fe5c38366-lightbox)

Click **Start Campaign** when you’re ready to activate your workflow!

Now you can prevent your workspace from sending emails to undeliverable email addresses by proactively and automatically verifying them.