Blacklist domains
Add domains to the agency blacklist. Blacklisting a domain does not immediately change the status of existing prospects. Instead, it prevents all current and future client accounts from contacting prospects associated with that domain. A prospect's status will be updated to BLACKLISTED
during campaign processing.
Request
Endpoint
POST https://api.woodpecker.co/rest/v2/agency/blacklist/domains
Headers
x-api-key: {YOUR_API_KEY}
Content-type: application/json
For details on how to authenticate your requests, please see the authentication guide.
Body
The request body is a JSON object with the property domains
holding an array of domains.
You can add up to 500 domains per request
{
"domains": [
"baddomain.com",
"blacklistedomain.io",
"nomoreemails.co"
]
}
Field | Type | Description |
---|---|---|
domains | array[string] | List of blacklisted domains |
Request sample
Blacklist a list of domains
- cURL
- Python
- Java
- Node.js
curl --request POST \
--url "https://api.woodpecker.co/rest/v2/agency/blacklist/domains" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"domains": [
"baddomain.com",
"blacklistedomain.io",
"nomoreemails.co"
]
}'
import requests
def blacklist_domains():
url = "https://api.woodpecker.co/rest/v2/agency/blacklist/domains"
headers = {
"x-api-key": "{YOUR_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"domains": [
"baddomain.com",
"blacklistedomain.io",
"nomoreemails.co"
]
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 201:
return response.json()
else:
raise Exception(f"POST request failed: {response.status_code}, {response.text}")
if __name__ == "__main__":
try:
data = blacklist_domains()
print("POST response:", data)
except Exception as e:
print("Error:", e)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class WoodpeckerApiClient {
private static final String API_KEY = "{YOUR_API_KEY}";
private static final String URL = "https://api.woodpecker.co/rest/v2/agency/blacklist/domains";
public static void main(String[] args) {
try {
HttpClient client = HttpClient.newHttpClient();
String jsonPayload = "{\"domains\": [\"baddomain.com\", \"blacklistedomain.io\", \"nomoreemails.co\"]}";
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(URL))
.header("Content-Type", "application/json")
.header("x-api-key", API_KEY)
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 201) {
System.out.println("POST response: " + response.body());
} else {
System.err.println("POST request failed: " + response.statusCode());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
const axios = require('axios');
async function blacklistDomains() {
const url = 'https://api.woodpecker.co/rest/v2/agency/blacklist/domains';
const headers = {
'x-api-key': '{YOUR_API_KEY}',
'Content-Type': 'application/json'
};
const data = {
domains: [
'baddomain.com',
'blacklistedomain.io',
'nomoreemails.co'
]
};
try {
const response = await axios.post(url, data, { headers });
console.log('POST response:', response.data);
} catch (error) {
console.error('POST request failed:', error.response ? error.response.status : error.message);
}
}
blacklistDomains();
Response
Response examples
- 201
- 400
- 401
- 404
- 500
The requested domains have been blacklisted
Status: 201
Body: none
Invalid request parameters or malformed request syntax.
{
"title": "Bad Request",
"status": 400,
"detail": "You can blacklist up to 500 records in one request." | "Value of domains is incorrect." | "No data found. Provide at least one domain.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
An issue with authorization. Please review the authorization guide
{
"title": "Unauthorized",
"status": 401,
"detail": "Invalid api key",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Please review the request URL.
{
"title": "Not Found",
"status": 404,
"detail": "Requested resource does not exist",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |
Unknown error, please try again later
{
"title": "Internal server error",
"status": 500,
"detail": "An unexpected error has occurred. Please try again later.",
"timestamp": "2025-03-05 17:57:00"
}
Body schema
Field | Type | Description |
---|---|---|
title | string | A short title describing the error |
status | integer | The HTTP status code |
detail | string | A detailed message explaining the error |
timestamp | string | The timestamp when the error occurred, YYYY-MM-DD HH:MM:SS UTC |