< Customer.io Actions

Create a Lead in Close.io

Close.io is a streamlined sales platform that helps you close more deals. With built-in calling and automatic email tracking, you can focus on selling rather than data entry. In our example, we're going to show you how to send leads from Customer.io into Close.io, using our segment triggers.

Show me how!

The finished product:

Create a Lead in Close.io with Customer.io

If you don’t already have an account, you can create one at Close.io.

At any point, you can read all about adding a lead to Close.io via their API. Their docs include details on custom fields, give you example data, and more.

Get your Close.io API key

Once you have a Close.io account, go to [your settings page](https://app.close.io/settings/) and then click Your API Keys.

Once there, click Generate New API Key.

Create your campaign

The simplest case is to push a lead into Close.io for every signup that enters Customer.io. For your trigger, you can simply use the "Signed Up" segment that comes by default when setting up Customer.io, but you can create more sophisticated behaviors by using Customer.io segments.

You'll want to use a segment triggered campaign to ensure that the campaign is entered once per profile. This will prevent duplicate leads from being generated (which could happen with an event triggered campaign).

Add your webhook action to the workflow

Click "Webhook" to add a new webhook action in the campaign’s workflow. We'll call our webhook "Send a lead to Close.io".

Create your webhook

Next, click "Add Request" to configure the details of your webhook.

To fill in the request URL, you’ll use your API Key as the username. For example, if your API Key is abcdef0123456789, your URL will look like this:

Compose your webhook's body

Generally, a lead in Close.io will map to a profile in Customer.io. You’ll like store a subset of the data contained within a user profile attribute in Customer.io.

In order to create a lead in Close.io, you’ll likely want to send details like name, URL, contacts, and possibly custom data if you’ve created custom fields in Close.io. Below is a JSON example showing an example. Note: name in Close.io refers to the name of the lead (i.e. the company), not the contact name.

Using Liquid, we’ll insert the values from Customer.io into the required JSON format to add a lead to Close.io. If some values may not exist in Customer.io, but are required in Close.io, use fallbacks to provide a value.

Using the Composer Preview pane, verify that the JSON data is formatted correctly. Note: you can use a tool like JSON Lint to help find errors in your JSON.

At this point, your webhook composer should look something like this:

Send test request

Test out the mapping of your data into Close.io to ensure that the required fields and formatting work as expected.

Use the "Send Request" button to send your previewed request to Close.io. A 200 OK message will confirm that the request was received.


Once the campaign action is turned from Queue Draft to Send Automatically, leads will flow into Close.io based on the trigger conditions of your campaign. You're all done!

We’re excited to hear how you end up using Slack with Customer.io’s Webhook Action. If you have any trouble, let us know! We're happy to help.