> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailbison.com/llms.txt
> Use this file to discover all available pages before exploring further.

# POST Requests (with examples)

<Warning>
  This page covers using POST requests for all non-native actions, the majority of use cases can use the [native EmailBison enrichments](/low-code-tools/clay/enrichments).
</Warning>

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](/leads/creating-a-lead), and then chain an API call to [add the leads to a campaign](/campaigns/adding-leads-to-a-campaign).

## 1. Adding a lead to EmailBison

For this example, we have a Clay table containing leads with the following columns.

```json theme={null}
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.

<Tabs>
  <Tab title="Text" icon="text">
    <Tip>
      There are text and video versions of this section.<br /> Click the tab icons above this tip to switch between them.
    </Tip>

    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.

    ```bash theme={null}
    https://subdomain.yourdomain.com/api/leads
    ```

    6. For the body of the request in `Setup Inputs` -> `Body`, refernce the `API Reference` to view the parameters this request takes.
    7. For example, for the `first_name` parameter, we will input `/` and find the `First Name` column in our Clay table.
    8. 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`<br />
    9. The final request will look like the following image.
    10. Save the enrichment
  </Tab>

  <Tab title="Video" icon="images">
    <Tip>
      There are text and video versions of this section.<br /> Click the tab icons above this tip to switch between them.
    </Tip>

    The following video will implement the text instructions on a Clay table.

    <Frame>
      <video autoPlay muted loop playsInline controls className="w-full aspect-video rounded-xl" src="https://mintcdn.com/emailbison-306cc08e/6vP4IPDHlIEu3rWW/images/clay_add_lead.mp4?fit=max&auto=format&n=6vP4IPDHlIEu3rWW&q=85&s=c399f75206c853b26223ca200da99aaf" type="video/mp4" data-path="images/clay_add_lead.mp4" />
    </Frame>
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Text" icon="text">
    <Tip>
      There are text and video versions of this section.<br /> Click the tab icons above this tip to switch between them.
    </Tip>

    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.

    ```bash theme={null}
    https://subdomain.yourdomain.com/api/campaigns/{campaign_id}/leads/attach-leads
    ```

    6. 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.
    7. For the body of the request, refernce the `API Reference` to view the parameters this request takes.
    8. Under `Setup Inputs` -> `Body`, input the JSON curly braces (`{}`), a key named `lead_ids`, and then square brackets (`[]`) to denote an array.
    9. 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.
    10. Save the enrichment.
  </Tab>

  <Tab title="Video" icon="images">
    <Tip>
      There are text and video versions of this section.<br /> Click the tab icons above this tip to switch between them.
    </Tip>

    The following video will implement the text instructions on a Clay table.

    <Frame>
      <video autoPlay muted loop playsInline controls className="w-full aspect-video rounded-xl" src="https://mintcdn.com/emailbison-306cc08e/6vP4IPDHlIEu3rWW/images/clay_attach_lead.mp4?fit=max&auto=format&n=6vP4IPDHlIEu3rWW&q=85&s=a542adbb28d9164fb09e1568ee2c9e00" type="video/mp4" data-path="images/clay_attach_lead.mp4" />
    </Frame>
  </Tab>
</Tabs>

***

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.
