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

# Create or Update Lead

Add new leads or update existing leads in your EmailBison workspace directly from your Clay table.

<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. **Add the Enrichment**
           <br />
       * In your Clay table, click `+ Add column`
       * Select `Enrichments`
       * Search for and select `"Create or update lead"`

    2. **Select Your Workspace**

           <br />

       Choose your desired EmailBison account (workspace) from the dropdown.

           <Tip>
             If you don't see your workspace, click `+ Add account` and [connect your workspace](/low-code-tools/clay/workspace-setup).
           </Tip>

    3. **Map Your Data**

           <br />

       Under `Setup Inputs`, map the required columns:

       * `First Name` (required)
       * `Last Name` (required)
       * `Email` (required)

       All other fields are optional.

           <Note>
             If you are adding a custom variable, it must already exist in EmailBison. Follow the steps below to create a custom variable if needed.
           </Note>

           <Accordion title="Creating a Custom Variable">
             If you need to create a custom variable before running the Create or Update Lead enrichment:

             1. Click `+ Add column`, select `Enrichments`, and search for `HTTP API` enrichment
             2. Select `Configure` and authenticate through one of your connected accounts
                      <Tip>
                        If you don't see any accounts, follow the [authentication instructions](/low-code-tools/clay/authenticating-requests).
                      </Tip>
             3. Under `Setup Inputs` → `Method`, select `POST`
             4. Under `Setup Inputs` → `Endpoint`, input:
                ```bash theme={null}
                https://subdomain.yourdomain.com/api/custom-variables
                ```
             5. In `Setup Inputs` → `Body`, input:

                ```json theme={null}
                {
                  "name": "New Name"
                }
                ```

                Where `"New Name"` is the value of your new custom variable name.

                **Example:**

                ```json theme={null}
                {
                  "name": "Industry"
                }
                ```

                You may also map this value using `/` to insert data from a column.
             6. Save the enrichment and run it to see the response
           </Accordion>

    4. **Configure Update Behavior**

           <br />

       Under `Setup Input` → `Select existing lead behaviour`, you have two options:

       * `PUT` (Full Replacement) - Replaces the entire lead with only the fields you send. Any fields you don't include will be removed.
       * `PATCH` (Partial Update) - Updates only the specific fields you send. All other fields remain unchanged.

       Select the option that works best for your use case.

           <Accordion title="See Examples">
             **PUT Example (Full Replacement)**

             If you send:

             ```json theme={null}
             {
               "first_name": "Alex",
               "email": "alex@new.com"
             }
             ```

             And the existing lead has:

             ```json theme={null}
             {
               "first_name": "Alex",
               "email": "alex@example.com",
               "phone": "123-4567"
             }
             ```

             **Result:** The lead is replaced with only the fields you sent. The `phone` field is **removed** because it wasn't included.

             ***

             **PATCH Example (Partial Update)**

             If you send:

             ```json theme={null}
             {
               "email": "alex@new.com"
             }
             ```

             And the existing lead has:

             ```json theme={null}
             {
               "first_name": "Alex",
               "email": "alex@example.com",
               "phone": "123-4567"
             }
             ```

             **Result:** Only the `email` is updated to `alex@new.com`. The `first_name` and `phone` fields remain unchanged.
           </Accordion>

    5. **Save and Run**

           <br />

       After you've filled out all the required fields, save and add the enrichment as a column in your table. Run it to create or update leads in your workspace.

           <Tip>
             Set this column to auto-run if you need your leads to be added or updated whenever new data flows into your table.
           </Tip>
  </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/Kzt26f4kxjobhFrT/images/create-or-update-lead.mp4?fit=max&auto=format&n=Kzt26f4kxjobhFrT&q=85&s=831c4640c1f49bb05e856f68c3e2b299" type="video/mp4" data-path="images/create-or-update-lead.mp4" />
    </Frame>
  </Tab>
</Tabs>
