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

# How Webhooks Work

> Receive real-time webhook notifications when Enrow searches and verifications complete, instead of polling the API

## Why use webhooks?

Webhooks let results come to you instead of you repeatedly asking for them. Rather than polling a GET endpoint until a search finishes, Enrow sends each result to your server the moment it's ready — saving requests, reducing latency, and keeping your code simple.

**Stop wasting requests — let results come to you.**

### Polling

Your app repeatedly asks "is it done yet?" until the result is ready.

### Webhook

Enrow notifies your server the instant the result is ready.

POST /email/find/single

Because every Enrow endpoint is **asynchronous**, webhooks are the recommended way to receive results across [Email Finder](https://docs.enrow.io/api-reference/email-finder/find-single.md), [Email Verifier](https://docs.enrow.io/api-reference/email-verifier/verify-single.md), and [Phone Finder](https://docs.enrow.io/api-reference/phone/find-single.md). Webhooks also bypass [rate limits](https://docs.enrow.io/rate-limits.md) entirely, since Enrow calls you rather than the other way around.

## How does a webhook flow work?

A webhook flow turns a single search request into an automatic delivery. You tell Enrow where to send results, and Enrow does the rest:

1. You **POST** a search request with a `webhook` URL in the `settings`
2. Enrow returns a search ID immediately
3. Enrow processes the search in the background
4. When complete, Enrow **POSTs** results to your webhook URL

## How do I set up a webhook?

You can register a webhook in two ways, depending on whether you want it for one search or every search:

1. **Per-request**: Include a `webhook` URL in the `settings` object of any API call
2. **Global**: Set a default webhook on the [API page](https://app.enrow.io/api) of the dashboard. Enrow checks the URL when you save it: see [How do I verify my webhook endpoint?](#verify)

```json theme={null}
{
  "fullname": "Dwight Schrute",
  "company_domain": "dundermifflin.com",
  "settings": {
    "webhook": "https://your-app.com/webhooks/enrow"
  }
}
```

When a request includes its own `webhook`, what happens to the default one depends on the endpoint:

* **Email Finder**: Enrow notifies both URLs (once if they are the same)
* **Phone Finder** and **Email Verifier**: the per-request URL replaces the default one

> [!WARNING]
>
> Your webhook endpoint must be publicly reachable and return a `2xx` status code. Use HTTPS: plain HTTP URLs are accepted but not recommended. Enrow sends each notification once and does not retry a failed delivery, so you can always fall back on the matching GET endpoint.

## How do I verify my webhook endpoint?

When you save a new default webhook URL on the [API page](https://app.enrow.io/api), Enrow first sends it a one-time verification request to confirm that you control the endpoint. The URL is saved only if your endpoint answers it correctly.

Enrow sends a `POST` request with this JSON body:

```json theme={null}
{
  "event": "endpoint_verification",
  "challenge": "3f9c1e2a-7b4d-4c8e-9a51-2d6f0b7e8c13"
}
```

Your endpoint must reply **within 5 seconds** with a `2xx` status code and send back the same `challenge` value, either as the raw response body or as JSON:

```json theme={null}
{
  "challenge": "3f9c1e2a-7b4d-4c8e-9a51-2d6f0b7e8c13"
}
```

For example, with Node.js and Express:

```javascript theme={null}
app.post('/webhooks/enrow', express.json(), (req, res) => {
  if (req.body.event === 'endpoint_verification') {
    return res.json({ challenge: req.body.challenge });
  }
  res.sendStatus(200);
  // Then process the result in the background
});
```

If the check fails, the app shows why (no reply within 5 seconds, a status other than `2xx`, a `challenge` that doesn't match, an unreachable URL, or a private or internal address) and your current webhook stays active. A `webhook` passed in the `settings` of a request is not checked this way.

## Which events trigger a webhook call?

Six types of events can trigger a webhook call, one per endpoint and search type:

| Event | Description |
| - | - |
| `single_search_finished` | A single email search has finished |
| `bulk_search_finished` | A bulk email search has finished |
| `verification_finished` | A single email verification has finished |
| `bulk_verification_finished` | A bulk email verification has finished |
| `single_phone_search_finished` | A single phone search has finished |
| `bulk_phone_search_finished` | A bulk phone search has finished |

## What does a webhook payload look like?

The webhook payload depends on the endpoint and whether the search was single or bulk. Single searches deliver the full result directly, while bulk searches deliver a completion notification that you follow up with a GET request.

### Email Finder — Single

For single searches, you receive the **full result directly** in the webhook notification. This removes the need to perform a GET request.

```json theme={null}
{
  "event": "single_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "credits": {
    "cost": 1
  },
  "result": {
    "email": "dwight.schrute@dundermifflin.com",
    "qualification": "valid",
    "custom": "your_custom_data",
    "info": {
      "company_domain": "dundermifflin.com",
      "fullname": "Dwight Schrute",
      "firstname": "Dwight",
      "lastname": "Schrute"
    }
  }
}
```

#### Search from a LinkedIn profile URL

For a search launched from a [LinkedIn profile URL](https://docs.enrow.io/api-reference/email-finder/find-single.md#search-from-a-linkedin-profile-url), `result` also carries `linkedin_status` and `linkedin_url` (the URL you sent). `info` is only included when an email is found: a search that finds nothing never names the person. `credits.cost` is the final cost, like `credits_used` in the [GET response](https://docs.enrow.io/api-reference/email-finder/get-single-result.md#results-of-a-search-from-a-linkedin-profile-url), which also explains each `linkedin_status`.

```json Email found theme={null}
{
  "event": "single_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "credits": {
    "cost": 1
  },
  "result": {
    "email": "dwight.schrute@dundermifflin.com",
    "qualification": "valid",
    "linkedin_status": "found",
    "linkedin_url": "https://www.linkedin.com/in/dwight-schrute",
    "custom": { "crm_id": "lead_001" },
    "info": {
      "company_domain": "dundermifflin.com",
      "company_name": "Dunder Mifflin",
      "fullname": "Dwight Schrute",
      "firstname": "Dwight",
      "lastname": "Schrute"
    }
  }
}
```

```json No email found theme={null}
{
  "event": "single_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "credits": {
    "cost": 0.25
  },
  "result": {
    "qualification": "invalid",
    "linkedin_status": "no_current_company",
    "linkedin_url": "https://www.linkedin.com/in/dwight-schrute",
    "custom": { "crm_id": "lead_001" }
  }
}
```

### Email Finder — Bulk

For bulk searches, you receive a notification that the batch is finished. Then call the [GET /email/find/bulk](https://docs.enrow.io/api-reference/email-finder/get-bulk-results.md) endpoint with the `id` to retrieve results.

```json theme={null}
{
  "event": "bulk_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "credits": {
    "cost": 2284
  }
}
```

### Email Verifier — Single

The full result is included directly — no GET request needed.

```json theme={null}
{
  "event": "verification_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "email": "pam.beesly@dundermifflin.com",
  "qualification": "valid",
  "custom": "your_custom_data"
}
```

### Email Verifier — Bulk

This is a notification only. Call [GET /email/verify/bulk](https://docs.enrow.io/api-reference/email-verifier/get-bulk-verifications.md) with the `id` to retrieve results.

```json theme={null}
{
  "event": "bulk_verification_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "credits": {
    "cost": 386.25
  }
}
```

### Phone Finder — Single

The full result is included directly — no GET request needed.

```json theme={null}
{
  "event": "single_phone_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt",
  "result": {
    "number": "+15705551234",
    "params": {
      "linkedin_url": "https://www.linkedin.com/in/michael-scott"
    },
    "qualification": "found"
  }
}
```

### Phone Finder — Bulk

This is a notification only. Call [GET /phone/bulk](https://docs.enrow.io/api-reference/phone/get-bulk-results.md) with the `id` to retrieve results.

```json theme={null}
{
  "event": "bulk_phone_search_finished",
  "id": "910f3e13-b2bf-442d-ab0b-4cf44dfrij84fjrt"
}
```

## How are single and bulk webhooks different?

Single-search webhooks contain the complete result, so no extra call is needed. Bulk-search webhooks only signal that the batch is done — you then fetch the results with the matching GET endpoint.

| Type | Single searches | Bulk searches |
| - | - | - |
| **Payload** | Full result included | Notification only (ID, plus credits except for phone searches) |
| **GET needed?** | No | Yes — use the GET endpoint with the `id` |

> [!NOTE]
>
> For single searches, the webhook contains everything you need. For bulk searches, the webhook tells you the batch is done — then you fetch the results.

## What are the best practices for webhook endpoints?

A reliable webhook endpoint returns quickly, uses HTTPS, and tolerates the occasional duplicate. Follow these practices to keep deliveries dependable:

> [accordion] Return 200 Quickly
>
> Process webhook payloads asynchronously. Return a `200` immediately, then handle the data in a background job.

> [accordion] Use HTTPS
>
> Use an HTTPS endpoint so results travel encrypted. Plain HTTP URLs are accepted, but not recommended.

> [accordion] Handle Duplicates
>
> In rare cases, webhooks may be delivered more than once. Use the `id` field to deduplicate.

> [accordion] Use Custom Fields
>
> Pass `custom` data in your requests to identify which record a webhook result belongs to:
>
> ```json theme={null}
> {
>   "fullname": "Dwight Schrute",
>   "company_domain": "dundermifflin.com",
>   "custom": { "crm_id": "lead_001" }
> }
> ```
>
> The `custom` field is returned as-is in the webhook payload.

## Should I use webhooks or polling?

Use webhooks for production and polling only for quick prototyping or debugging. Webhooks deliver results in real time without consuming your request quota, while polling makes repeated GET calls that count against your [rate limits](https://docs.enrow.io/rate-limits.md).

| | Webhooks | Polling (GET) |
| - | - | - |
| **Latency** | Real-time | Depends on poll interval |
| **API calls** | 0 (Enrow calls you) | Multiple calls per search |
| **Rate limit impact** | None | Consumes quota |
| **Complexity** | Requires endpoint setup | Simpler to implement |

> [!NOTE]
>
> We recommend webhooks for production use. Use polling only for quick prototyping or debugging.

## FAQ

> [accordion] Do webhooks cost extra credits?
>
> No. Webhooks don't consume additional credits: you only pay for the search itself. Email Finder and Email Verifier payloads report the credit cost in the `credits.cost` field. It is the final cost once refunds are applied: `0` for a single search that found nothing (`0.25` for an email search from a LinkedIn profile URL or for an account whose success rate is abnormally low), and for a bulk, the rows found plus any charged misses. Phone Finder payloads don't include the cost. See [Credits & billing](https://docs.enrow.io/credits-billing.md) for per-endpoint costs.

> [accordion] What happens if my endpoint doesn't return a 200?
>
> Enrow sends each notification once. If your server is unreachable or responds with a status other than `2xx`, the delivery fails and is not retried. You can always retrieve the results by polling the relevant GET endpoint with the search `id`.

> [accordion] How do I match a webhook to the original request?
>
> Use the `id` from the search response, or pass a `custom` object in your request — it's returned as-is in the webhook payload so you can map results back to your own records, such as a CRM lead ID.

> [accordion] Why didn't I receive a webhook?
>
> The most common causes are an endpoint that doesn't return `2xx`, a server that times out, or a URL that isn't publicly reachable. Failed deliveries are not retried: fetch the result with the matching GET endpoint and the search `id`. For broader troubleshooting, see [Error handling](https://docs.enrow.io/error-handling.md) and [Status codes](https://docs.enrow.io/status-codes.md).

## Next steps

> [card] [Find an email](https://docs.enrow.io/api-reference/email-finder/find-single.md)
>
> Pass a webhook URL in settings to get the result delivered automatically.

> [card] [Get bulk results](https://docs.enrow.io/api-reference/email-finder/get-bulk-results.md)
>
> Fetch batch results after a bulk\_search\_finished webhook fires.

> [card] [Authentication](https://docs.enrow.io/authentication.md)
>
> How to pass your API key in the x-api-key header.

> [card] [Rate limits](https://docs.enrow.io/rate-limits.md)
>
> See why webhooks avoid the request quota that polling consumes.


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