Delete domains from the blacklist
Remove specific domains from the blacklist. Removing a domain from the list doesn't change the status of a prospect if it was previously set to BLACKLISTED
.
Request
Endpoint
DELETE https://api.woodpecker.co/rest/v2/blacklist/domains
Headers
x-api-key: {YOUR_API_KEY}
Content-type: application/json
Body
The request body is a JSON object with the property domains
whose value is an array of domains to remove.
info
You can remove 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
- Java
- Node.js
curl --request POST \
--url "https://api.woodpecker.co/rest/v2/blacklist/domains" \
--header "x-api-key: {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--data '{
"domains": [
"baddomain.com",
"blacklistedomain.io",
"nomoreemails.co"
]
}'
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.util.List;
import com.fasterxml.jackson.databind.ObjectMapper;
public class WoodpeckerApiClient {
public static void removeDomainsFromBlacklist(String apiKey, List<String> domains) throws Exception {
String url = "https://api.woodpecker.co/rest/v2/blacklist/domains";
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(new BlacklistRequest(domains));
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.method("DELETE", HttpRequest.BodyPublishers.ofString(jsonBody))
.header("x-api-key", apiKey)
.header("Content-Type", "application/json")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Response status: " + response.statusCode());
System.out.println("Response body: " + response.body());
}
private static class BlacklistRequest {
public List<String> domains;
public BlacklistRequest(List<String> domains) {
this.domains = domains;
}
}
}
const axios = require("axios");
async function removeDomainsFromBlacklist(apiKey, domains) {
try {
const url = "https://api.woodpecker.co/rest/v2/blacklist/domains";
const response = await axios({
method: "delete",
url: url,
headers: {
"x-api-key": apiKey,
"Content-Type": "application/json",
},
data: { domains },
});
console.log("Response status:", response.status);
console.log("Response data:", response.data);
return response.data;
} catch (error) {
console.error("Error:", error.response ? error.response.data : error.message);
throw error;
}
}
module.exports = { removeDomainsFromBlacklist };
Response
Response examples
- 200
- 400
- 401
- 404
- 500
The domains were deleted successfully if they were listed.
Status: 200
Body: none
Invalid request or malformed request syntax.
{
"title": "Bad Request",
"status": 400,
"detail": "You can remove up to 500 records in one request." | "The domains parameter can not be empty.",
"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 |