This page will give step-by-step instructions on making POST requests from Clay to EmailBison. These instructions can be slightly altered for different POST, PUT, and PATCH endpoints, the overall Clay enrichment will be the same. This page will provide the instructions to add leads to EmailBison, and then chain an API call to add the leads to a campaign.

1. Adding a lead to EmailBison

For this example, we have a Clay table containing leads with the following columns.
Email
First Name
Last Name
Company
Title
Notes
AI Enriched Paragraph
Linkedin URL
We will start by creating a column that will add each lead to EmailBison.
There are text and video versions of this section.
Click the tab icons above this tip to switch between them.
  1. In your Clay table, add a new column. Select Add enrichment.
  2. Search for and select HTTP API.
  3. Authenticate through one of the methods listed above (select an account, or pass in an Authorization header). For this example, we will select an account from the dropdown.
  4. Under Setup Inputs -> Method, select POST from the dropdown.
  5. Under Setup Inputs -> Endpoint, input the leads endpoint.
https://subdomain.yourdomain.com/api/leads
  1. For the body of the request in Setup Inputs -> Body, refernce the API Reference to view the parameters this request takes.
  2. For example, for the first_name parameter, we will input / and find the First Name column in our Clay table.
  3. Repeat this step for all the columns in your Clay table. For any columns in the table that are not specifically named in the EmailBison request, we will use the custom_variables array. An example would be AI Enriched Paragraph or Linkedin URL
  4. The final request will look like the following image.
  5. Save the enrichment

2. Attaching a lead to an EmailBison campaign

These instructions will follow the previous instructions. We will also assume we have a Clay column that decides which campaign each lead will go to.
There are text and video versions of this section.
Click the tab icons above this tip to switch between them.
  1. In your Clay table, add a new column. Select Add enrichment.
  2. Search for and select HTTP API.
  3. Authenticate through one of the methods listed above (select an account, or pass in an Authorization header). For this example, we will select an account from the dropdown.
  4. Under Setup Inputs -> Method, select POST from the dropdown.
  5. Under Setup Inputs -> Endpoint, input the attach leads to campaign endpoint.
https://subdomain.yourdomain.com/api/campaigns/{campaign_id}/leads/attach-leads
  1. Replace {campaign_id} with the ID of the EmailBison campaign you want these leads to be attached to. Alternatively, use the Clay / feature to use the the Clay column that contains the campaign ID.
  2. For the body of the request, refernce the API Reference to view the parameters this request takes.
  3. Under Setup Inputs -> Body, input the JSON curly braces ({}), a key named lead_ids, and then square brackets ([]) to denote an array.
  4. For the value of the lead_ids array, input /, find the HTTP API enrichment that ran before this one, click on it, click on data, and then click on id. This is the ID EmailBison will use to identify this lead, and returns to you when you create a lead.
  5. Save the enrichment.

After implementing these steps, every row (lead) in your Clay table will be added to EmailBison, and then attached to a campaign you choose after the enrichments run.