> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.heyreach.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.heyreach.io/_mcp/server.

# EnrichEmail

POST https://api//api/public/enrichment/enrich-email
Content-Type: application/json

## Creates an email-enrichment job for a single lead.

Enrichment runs asynchronously - poll `enrich-email/check-job/{jobId}` with the returned `jobId` until the job reaches a terminal status. Provide exactly one of `profileUrl` or `leadMemberId`.

### Body Parameters

* **profileUrl** *(string, optional)*: The LinkedIn profile URL of the lead to enrich. If no lead with this URL exists yet, one is created automatically. Cannot be combined with `leadMemberId`.

* **leadMemberId** *(string, optional)*: The LinkedIn member id of an existing lead to enrich. Cannot be combined with `profileUrl`. The lead must already exist in the system.

### Response fields

* **jobId** *(long)*: Id of the created enrichment job. Pass this to `enrich-email/check-job/{jobId}` to poll for the result.

### Errors

All of the following return **400** with body `{ "errorMessage": "..." }`:

* Neither `profileUrl` nor `leadMemberId` provided: `One of the following parameters must be provided: profileUrl or leadMemberId.`

* Both `profileUrl` and `leadMemberId` provided: `Only one of the following parameters should be provided: profileUrl or leadMemberId.`

* `profileUrl` is not a valid LinkedIn profile URL: `The provided URL is not a valid ProfileUrl: <url>`

Returns **404** with body `{ "errorMessage": "..." }` when `leadMemberId` is provided but no lead with that id exists: `Lead with id <leadMemberId> does not exist.`

Reference: https://docs.heyreach.io/hey-reach-api/enrichment/enrich-email

## Request

### Headers

- `X-API-KEY` (string, optional) — API key header using this scheme. Example: "X-API-KEY: \{API\_KEY}"

### Body (application/json)

This endpoint expects an object.

- `profileUrl` (string, required)
- `leadMemberId` (any, optional, nullable)

## Response

### 200

OK

- `jobId` (integer, required)

## Examples

**Request**

```json
{
  "profileUrl": "https://www.linkedin.com/in/john_doe"
}
```

**Response**

```json
{
  "jobId": 48213
}
```

**SDK Code**

```python
import requests

url = "https://api//api/public/enrichment/enrich-email"

payload = { "profileUrl": "https://www.linkedin.com/in/john_doe" }
headers = {
    "X-API-KEY": "{{HR_API_KEY}}",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api//api/public/enrichment/enrich-email';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '{{HR_API_KEY}}', 'Content-Type': 'application/json'},
  body: '{"profileUrl":"https://www.linkedin.com/in/john_doe"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api//api/public/enrichment/enrich-email"

	payload := strings.NewReader("{\n  \"profileUrl\": \"https://www.linkedin.com/in/john_doe\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-KEY", "{{HR_API_KEY}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api//api/public/enrichment/enrich-email")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '{{HR_API_KEY}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"profileUrl\": \"https://www.linkedin.com/in/john_doe\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api//api/public/enrichment/enrich-email")
  .header("X-API-KEY", "{{HR_API_KEY}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"profileUrl\": \"https://www.linkedin.com/in/john_doe\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api//api/public/enrichment/enrich-email', [
  'body' => '{
  "profileUrl": "https://www.linkedin.com/in/john_doe"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '{{HR_API_KEY}}',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/enrichment/enrich-email");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "{{HR_API_KEY}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"profileUrl\": \"https://www.linkedin.com/in/john_doe\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "{{HR_API_KEY}}",
  "Content-Type": "application/json"
]
let parameters = ["profileUrl": "https://www.linkedin.com/in/john_doe"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/enrichment/enrich-email")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```