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

# Default and Clay: webhooks and the API

> How Default and Clay connect by webhook: call a Default workflow from a Clay table through an incoming webhook or the API, send records from a Default workflow to a Clay table with Send to Webhook, and where each tool fits for inbound enrichment.

Default and Clay connect by webhook. A Clay table calls a Default workflow through an
**Incoming Webhook** URL or the Default API, and a Default workflow sends records to a Clay table with
the **Send to Webhook** node.

Clay is not a native integration in Default. It has no card under **Settings** → **Integrations**,
and Default does not read or write Clay tables directly. Every connection on this page is an HTTP
request that 1 tool sends to the other.

## How Default and Clay connect

| Direction | Default side | Clay side | Typical use |
| - | - | - | - |
| Clay to Default | **Incoming Webhook** trigger | An HTTP API column that posts each row to the **Ingestion URL** | Route, assign, or sequence rows that Clay built or enriched |
| Clay to Default | **API** trigger, through `POST /v1/triggers/{trigger}` | An HTTP API column that calls the Default API with an API key | The same, when you want the workflow's execution ID and outcome in the response |
| Default to Clay | **Send to Webhook** node | A table that receives rows from a webhook | Send routed leads to Clay for research that can finish after the workflow run |

## Where Clay fits next to enrichment in Default

Teams that use both tools often keep Clay for work that can finish later, such as account research
and list building, and keep it off the path a live inbound lead takes to routing and the scheduler.
The 2 tools return data at different times:

| | **Enrich Data** node in Default | A Clay table |
| - | - | - |
| When results arrive | Within the workflow run. Later nodes in the same run can branch, route, and write to the CRM on them. | After Clay runs the table's columns on the row. The results reach Default only if Clay sends them back, for example to an **Incoming Webhook**, which starts another workflow run. |
| Where the data comes from | A single provider or a waterfall of up to 5 providers, such as Clearbit, Apollo, People Data Labs, and Wiza | The providers and columns set up in the Clay table |
| Keys and billing | Default supplies the provider data and bills it in enrichment credits, so you don't need provider keys of your own. | Set up in Clay |

For example, a demo request can run **Enrich Data**, then a **Multi-Branch** node on company size,
then **Round-Robin** and **Display Scheduler**, all while the visitor waits. See
[Enrichment nodes](/workflows/steps-enrichment) and [Waterfalls](/settings/configurations/waterfalls).

## Call a Default workflow from Clay with an incoming webhook

An incoming webhook accepts any JSON body. Use it when Clay should start a workflow for each row.

<Steps>
  <Step title="Create the webhook in Default">
    In **Workflows**, create a workflow and add the **Incoming Webhook** trigger. Under
    **Connected Webhook**, select **Create new webhook**.
  </Step>

  <Step title="Copy the URL and the secret">
    The trigger shows the **Ingestion URL** and the **Bearer secret**. Copy the URL, then reveal and
    copy the secret. The secret is shared by every incoming webhook in your workspace. See
    [Webhook Secret](/settings/webhook-secret).
  </Step>

  <Step title="Add an HTTP API column in Clay">
    In the Clay table, add an HTTP API column that sends a `POST` request to the **Ingestion URL**.
    Add a header named `Authorization` with the value `Bearer <your secret>`, and build a JSON body
    from the row's columns, for example:

    ```json theme={null}
    {
      "email": "jordan@acme.com",
      "first_name": "Jordan",
      "company_domain": "acme.com",
      "employee_count": 420
    }
    ```
  </Step>

  <Step title="Capture a sample">
    In the Default trigger, under **Test event**, select **Listen for test event**, then run the Clay
    column on 1 row within 5 minutes. Default stores that request as the sample and does not run the
    workflow for it. You can also select **Paste a sample** and paste the JSON.
  </Step>

  <Step title="Map the identity">
    Under **Identity mapping**, set **Person email** to the email field. Later nodes, such as
    **Enrich Data**, then treat the request as that person. If some rows have no email, also set
    **Company domain** to the domain field. Default uses the domain only for rows without an email.
  </Step>

  <Step title="Build and publish the workflow">
    Add the nodes that act on the row. Every field in the sample is in the data picker, so type
    `{{` to use it. Select **Publish**, then check that the status next to the
    [deployment switch](/workflows#the-enabled-switch) reads **Live**. A new workflow goes live when you first
    publish it. If the status reads **Paused**, turn the switch on.
  </Step>
</Steps>

Send 1 row per request. A request whose body is a list starts 1 workflow run with the whole list.
If the Clay column can run again on the same row, for example after the row changes, each run
starts the workflow again. Check the CRM with **Match Record** first and route only new records, so
a repeat request does not reassign an owner.

### How the Ingestion URL responds

| Response | What it means |
| - | - |
| `200` with `"accepted": true` | Default accepted the request. It returns `200` even when no published, enabled workflow uses the webhook. |
| `400` | The body is not valid JSON, or the value in the mapped **Person email** field is not a valid email. |
| `401` | The `Authorization` header is missing or the secret is wrong. |
| `404` | The webhook does not exist or was deleted. |
| `410` | The webhook is paused. Turn it back on in the trigger. |
| `413` | The body is larger than about 1 MB. |

## Call a Default workflow from Clay with the API

The **API** trigger starts a workflow from a request to the Default API. Use it when Clay needs the
workflow's result in the response.

| | Detail |
| - | - |
| Endpoint | `POST https://api.default.com/v1/triggers/{trigger}` |
| Authentication | An API key with the `triggers:write` permission, sent as `Authorization: Bearer <key>`. Create keys in **Settings** → **API Keys**. |
| Request body | The lead's `email`, the form's field values in `responses`, and optional `context`, such as the page URL and referrer. |
| Fields | The trigger's **Connected Form** defines which fields a request sends. `GET /v1/triggers` lists them. |
| Response | An `executionId` and an `outcome`: `scheduler`, `redirect`, or `none`. |
| Rate limit | 30 requests per minute per API key. Above that, the API returns `429` with a `Retry-After` header. |

Pace the Clay column so it stays under 30 requests per minute for each API key. For the request
format and error codes, see [Route and book through the API](/api/route-and-book) and
[Fire a trigger](/api-reference/triggers/fire-a-trigger).

## Send records from Default to Clay

The **Send to Webhook** node sends an HTTP request from a workflow to a Clay table's webhook URL.

<Steps>
  <Step title="Set up the table in Clay">
    Create a Clay table that receives rows from a webhook, and copy its webhook URL. If Clay gives
    the webhook an authentication token, copy that too.
  </Step>

  <Step title="Add Send to Webhook">
    In the Default workflow, add **Send to Webhook**. Set **Request Type** to **POST** and
    **Request URL** to the Clay webhook URL. If Clay gave you a token, add it under **Headers** with
    the header name Clay uses.
  </Step>

  <Step title="Build the body">
    Under **Body**, use the **Fields** tab to add a key for each column the Clay table expects, for
    example `email`, `company_domain`, and `assigned_rep`. Type `{{` to fill each value from the
    trigger or an earlier node.
  </Step>

  <Step title="Test the workflow">
    Select **Test**, fill in a sample, and select **Run Test**. Confirm the row arrived in Clay. A
    test sends the request for real.
  </Step>
</Steps>

Place the node where waiting on it costs nothing. It waits for Clay's reply, for up to 30 seconds,
before the next node runs. Good places are a workflow that no visitor waits on, such as one started
by **CRM Record Created**, or the end of a workflow after **Display Scheduler**.

Clay's reply confirms it received the row. To use what Clay finds, have the Clay table post its
results to a Default **Incoming Webhook**, and let that workflow write them to the CRM with
**Match Record** and **Update Record**.

**Send to Webhook** cancels a request after 30 seconds, does not follow redirects, and cannot reach
private network addresses. See [Send to Webhook](/workflows/steps-actions#send-to-webhook).

## Troubleshoot Clay and Default

| What you see | What to check |
| - | - |
| Clay's HTTP API column gets `401` | The `Authorization` header is missing, is not in the form `Bearer <secret>`, or the secret was rotated. |
| Clay gets `200` but nothing runs | No published, enabled workflow uses this webhook in its **Incoming Webhook** trigger. |
| Later nodes cannot find a row's fields | The sample did not include them. Capture or paste a new sample that has every field. |
| **Enrich Data** finds nothing to work on | Set **Person email** or **Company domain** under **Identity mapping**, or pass the value into **Email / Domain (optional)** directly. |
| **Match Record** finds no record | **Match Record** matches only on the fields you set in **Match Details**. Pick the row's email or domain there. |
| API calls from Clay get `429` | The column sends more than 30 requests per minute on 1 API key. Slow the column down. |
| The Clay table receives no rows from Default | Select **Runs** at the top of the workflow, open the run, and check the **Send to Webhook** status code and response. See [Run logs](/workflows/run-logs). |
| A lead is routed again when Clay reruns a row | Add **Match Record** before **Round-Robin**, and route only on the **No Match** branch. |

Related: [Default integrations](https://www.default.com/integrations)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.