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

# Zapier

> Connect Data Legion's person and company enrichment APIs to Zapier using Webhooks by Zapier. Step-by-step setup for endpoint, authentication, request body, and response handling.

Connect Data Legion to [Zapier](https://zapier.com) using the [Webhooks by Zapier](https://help.zapier.com/hc/en-us/articles/8496083355661-How-to-get-started-with-Webhooks-by-Zapier) app. This lets you call person and company enrichment APIs from any Zap.

## Prerequisites

* A Zapier account (Webhooks by Zapier requires a paid plan)
* A Data Legion API key

## Person Enrichment Setup

### Add the Webhooks Action

In your Zap, add a new action step. Search for **Webhooks by Zapier** and select the **Custom Request** event.

<Note>
  Use **Custom Request** instead of the **POST** event. Custom Request lets you set custom headers (needed for API key authentication) and send raw JSON in the body.
</Note>

### Configure the Request

Set the following fields:

| Field      | Value                                     |
| ---------- | ----------------------------------------- |
| **Method** | `POST`                                    |
| **URL**    | `https://api.datalegion.ai/person/enrich` |

See the [Person Enrichment API reference](/docs/api-reference/person-enrichment) for the full list of available fields.

### Headers

Add three headers:

| Key            | Value                             |
| -------------- | --------------------------------- |
| `Content-Type` | `application/json`                |
| `API-Key`      | Your Data Legion API key          |
| `User-Agent`   | Your app name (e.g. `Zapier/1.0`) |

### Data

Set **Payload Type** to **Raw** and enter the JSON body in the **Data** field:

```json theme={null}
{
  "email": "jane.doe@example.com"
}
```

To use data from a previous step in your Zap (for example, an email from a new CRM contact trigger), click the **Data** field and select the field from the dropdown. Zapier inserts a placeholder that gets replaced with the actual value at runtime.

For a Custom Request with raw JSON, build the JSON string with Zapier field references inserted where needed. For example, if the trigger provides an email field, the data field would look like:

```text theme={null}
{"email": "{{trigger_email}}"}
```

where `{{trigger_email}}` is the mapped field from your trigger step (the actual field reference appears as a pill in the Zapier editor).

You can add more input fields to improve match accuracy:

```json theme={null}
{
  "email": "jane.doe@example.com",
  "first_name": "Jane",
  "last_name": "Doe",
  "company": "Acme Corp",
  "birth_date": "1985-03-15"
}
```

To limit the response to specific fields, add `include_fields` to the body:

```json theme={null}
{
  "email": "jane.doe@example.com",
  "include_fields": "full_name,job_title,seniority_level,company_name,company_size,company_industry,work_email,mobile_phone,linkedin_url,city,state"
}
```

See the [Person Enrichment API reference](/docs/api-reference/person-enrichment) for all supported input fields.

### Response Handling

Zapier automatically parses the JSON response. The API returns:

```json theme={null}
{
  "matches": [
    {
      "person": {
        "full_name": "jane doe",
        "job_title": "senior product manager",
        "seniority_level": "senior",
        "company_name": "tech company",
        "work_email": "jane.doe@techcompany.com",
        "mobile_phone": "+15551234567",
        "linkedin_url": "https://www.linkedin.com/in/janedoe"
      },
      "match_metadata": {
        "matched_on": ["email"],
        "match_type": "exact",
        "match_confidence": "high"
      }
    }
  ],
  "total": 1
}
```

In subsequent steps, reference response fields using the path from the Webhooks step output. After testing the step, Zapier shows the parsed fields and you can map them by name:

| Field Path                             | Description  |
| -------------------------------------- | ------------ |
| `matches__0__person__full_name`        | Full Name    |
| `matches__0__person__job_title`        | Job Title    |
| `matches__0__person__seniority_level`  | Seniority    |
| `matches__0__person__company_name`     | Company      |
| `matches__0__person__company_size`     | Company Size |
| `matches__0__person__company_industry` | Industry     |
| `matches__0__person__work_email`       | Work Email   |
| `matches__0__person__mobile_phone`     | Phone        |
| `matches__0__person__linkedin_url`     | LinkedIn URL |

<Note>
  If the email doesn't match any records, the API returns HTTP 404. Use Zapier's [Paths](https://help.zapier.com/hc/en-us/articles/8496288555917) or [Filter](https://help.zapier.com/hc/en-us/articles/8496276332557) steps to handle no-match responses and continue the Zap.
</Note>

### Test

Click **Test step** to send a test request. Verify that the response fields appear correctly in the output, then continue building your Zap.

## Company Enrichment Setup

The same approach works for company enrichment. Use the Company Enrich endpoint:

```text theme={null}
https://api.datalegion.ai/company/enrich
```

The request body takes a domain, name, LinkedIn ID, or ticker symbol. Add `include_fields` to limit the response:

```json theme={null}
{
  "domain": "example.com",
  "include_fields": "name,domain,legion_employee_count,industry"
}
```

In subsequent steps, reference company fields from `matches__0__company` (e.g., `matches__0__company__legion_employee_count`).

See the [Company Enrichment API reference](/docs/api-reference/company-enrichment) for all supported input and output fields.

## Example Zap: Enrich New CRM Contacts

A common pattern: trigger on new contacts, enrich them, and update the CRM record.

1. **HubSpot > New Contact** (or Salesforce, Pipedrive, etc.) — triggers when a new contact is created
2. **Webhooks by Zapier > Custom Request** — calls `POST /person/enrich` with the contact's email
3. **HubSpot > Update Contact** — writes enriched fields (title, company, phone, LinkedIn) back to the contact record

## Rate Limits

The Data Legion API returns rate limit headers on every response (`RateLimit-Remaining`, `RateLimit-Reset`). Zapier runs Zap steps sequentially, so rate limits are rarely hit for trigger-based Zaps. For bulk operations using Zapier's [Transfer tool](https://help.zapier.com/hc/en-us/articles/8496274335885-Transfer-existing-data-using-a-Zap), monitor your API plan limits when processing large datasets.

See [Rate Limiting](/docs/api-reference/overview#rate-limiting) for details.

## Related

* [Person Enrichment API](/docs/api-reference/person-enrichment)
* [Company Enrichment API](/docs/api-reference/company-enrichment)
* [Clay integration](/docs/integrations/clay) for Clay table enrichment
* [MCP Server](/docs/integrations/mcp-server) for AI assistant integrations
* [Webhooks by Zapier documentation](https://help.zapier.com/hc/en-us/articles/8496083355661-How-to-get-started-with-Webhooks-by-Zapier)
