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

# AddLeads

POST https://api//api/public/blacklist/AddLeads
Content-Type: application/json

Add up to **100** leads to your workspace's blacklist in one call. A blacklisted lead is excluded from your campaigns.

Each entry takes one or more identifiers, and **at least one is required**:

- **linkedInProfileId** *(optional)*: the member id of a lead HeyReach already holds - the value returned as `linkedin_id` by endpoints such as '/api/public/lead/GetLead'. The preferred identifier when you have one: it matches exactly and skips resolution entirely, so the entry is never in a `Matching` state. An id we do not hold is reported in `validationErrors` and creates no entry.
    
- **profileUrl** *(optional)*: a LinkedIn profile URL. Accepted forms are `linkedin.com/in/...` and Sales Navigator `linkedin.com/sales/people/...` / `linkedin.com/sales/lead/...`, with or without `https://` and `www.`. The legacy `/pub/` form, company URLs and bare domains are rejected. Scheme, host, query string, fragment and trailing slash are all normalized away, so every spelling of the same profile resolves to a single entry.
    
- **email** *(optional)*: an email address. When your workspace has reverse email lookup enabled and we do not already hold that email together with its profile URL, resolving it spends one reverse-lookup credit. Adding by profile URL, by name, or adding any company never costs a credit.
    
- **fullName** *(optional)*: a name-only entry. It is never sent to a resolution vendor; it excludes by exact, case-insensitive name comparison and is always returned as `BroadMatch`. A name is an exclusion rule in its own right, so a name-only entry lives alongside the profile entry for the same person rather than merging into it.
    

**The call returns 200 even when some entries do not land.** Read the result per entry rather than relying on the status code:

- **added**: how many entries were newly created.
    
- **entries**: one reference per input that produced a stored entry, correlated by **inputIndex** (its position in the list you submitted). **id** is what you pass to 'RemoveLeads', and **created** is `false` when the lead was already blacklisted. Entries that were already on the list are included deliberately, so you always have an id to undo with.
    
- **duplicates**: identifiers that were already blacklisted, or repeated within this batch.
    
- **validationErrors**: one message per entry that was skipped, for example an invalid URL or an entry with no identifier at all.

Reference: https://docs.heyreach.io/hey-reach-api/blacklist/add-leads

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

- `leads` (list of object, required)
  - `profileUrl` (string, required)

## Response

### 200

OK

- `added` (integer, required)
- `duplicates` (list of string, required)
- `validationErrors` (list of string, required)
- `entries` (list of object, required)
  - `inputIndex` (integer, required)
  - `id` (integer, required)
  - `created` (boolean, required)

## Examples

**Request**

```json
{
  "leads": [
    {
      "profileUrl": "https://www.linkedin.com/in/john-doe/"
    },
    {
      "profileUrl": "profileUrl"
    },
    {
      "profileUrl": "profileUrl"
    },
    {
      "profileUrl": "profileUrl"
    }
  ]
}
```

**Response**

```json
{
  "added": 2,
  "duplicates": [
    "https://www.linkedin.com/in/john-doe/"
  ],
  "validationErrors": [
    "'ACoAAB1234' is not a profile we hold."
  ],
  "entries": [
    {
      "inputIndex": 0,
      "id": 101,
      "created": false
    },
    {
      "inputIndex": 1,
      "id": 102,
      "created": true
    },
    {
      "inputIndex": 2,
      "id": 103,
      "created": true
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api//api/public/blacklist/AddLeads"

payload = { "leads": [{ "profileUrl": "https://www.linkedin.com/in/john-doe/" }, { "profileUrl": "profileUrl" }, { "profileUrl": "profileUrl" }, { "profileUrl": "profileUrl" }] }
headers = {
    "X-API-KEY": "<string>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api//api/public/blacklist/AddLeads';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<string>', 'Content-Type': 'application/json'},
  body: '{"leads":[{"profileUrl":"https://www.linkedin.com/in/john-doe/"},{"profileUrl":"profileUrl"},{"profileUrl":"profileUrl"},{"profileUrl":"profileUrl"}]}'
};

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/blacklist/AddLeads"

	payload := strings.NewReader("{\n  \"leads\": [\n    {\n      \"profileUrl\": \"https://www.linkedin.com/in/john-doe/\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    }\n  ]\n}")

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

	req.Header.Add("X-API-KEY", "<string>")
	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/blacklist/AddLeads")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<string>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"leads\": [\n    {\n      \"profileUrl\": \"https://www.linkedin.com/in/john-doe/\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    }\n  ]\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/blacklist/AddLeads")
  .header("X-API-KEY", "<string>")
  .header("Content-Type", "application/json")
  .body("{\n  \"leads\": [\n    {\n      \"profileUrl\": \"https://www.linkedin.com/in/john-doe/\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api//api/public/blacklist/AddLeads', [
  'body' => '{
  "leads": [
    {
      "profileUrl": "https://www.linkedin.com/in/john-doe/"
    },
    {
      "profileUrl": "profileUrl"
    },
    {
      "profileUrl": "profileUrl"
    },
    {
      "profileUrl": "profileUrl"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<string>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/blacklist/AddLeads");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<string>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"leads\": [\n    {\n      \"profileUrl\": \"https://www.linkedin.com/in/john-doe/\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    },\n    {\n      \"profileUrl\": \"profileUrl\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<string>",
  "Content-Type": "application/json"
]
let parameters = ["leads": [["profileUrl": "https://www.linkedin.com/in/john-doe/"], ["profileUrl": "profileUrl"], ["profileUrl": "profileUrl"], ["profileUrl": "profileUrl"]]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/blacklist/AddLeads")! 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()
```