Remove domain from Zone whitelist/blacklist

Hyun Kim
Hyun Kim
  • Updated
API endpoint: DELETE /api/zone/domain_perm
DELETE body
  • zone=ZONE
  • type=whitelist|blacklist
  • domain=d1.com d2.com space separated list of domains
Sample Response:
Response will output the remaining domains in the specified 'type' list, excluding the removed domain.
{"whitelist":"example.org"}
 
Shell
curl -X DELETE "https://brightdata.com/api/zone/domain_perm" -H "Content-Type: application/json" -H "Authorization: Bearer API_TOKEN" -d "{\"zone\":\"ZONE\",\"type\":\"TYPE\",\"domain\":\"example.org\"}"

Node.js

#!/usr/bin/env node
require('request-promise')({
	method: 'DELETE',
	url: 'https://brightdata.com/api/zone/domain_perm',
	json: {'zone': 'ZONE','type':'TYPE','domain':'example.org'},
	headers: {'Authorization': 'Bearer API_TOKEN'},
}).then(function(data){ console.log(data); },
	function(err){ console.error(err); });

Java

package example;

import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;

public class Example {
  public static void main(String[] args) throws Exception {
String body = "{\"zone\":\"ZONE\",\"type\":\"TYPE\",\"domain\":\"example.org\"}"; String res = Executor.newInstance() .addHeader("Authorization", "Bearer API_TOKEN")

.execute(Request.Delete("https://brightdata.com/api/zone/domain_perm"))
.bodyString(body, ContentType.APPLICATION_JSON))

.returnContent().asString();
System.out.println(res) }

}

C#

using System;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;

public class Program {
  public static async Task Main() {
    var client = new HttpClient();
    var requestMessage = new HttpRequestMessage {
      Method = HttpMethod.Delete,
RequestUri = new Uri("https://brightdata.com/api/zone/domain_perm"), Headers = { {"Authorization", "Bearer API_TOKEN"} },
Content = new StringContent(JsonConvert.SerializeObject(new {
zone = "ZONE", type = "TYPE", domain = "example.org"
}), Encoding.UTF8, "application/json")) }; var response = await client.SendAsync(requestMessage); var responseString = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseString); } }

Python

#!/usr/bin/env python
print('If you get error "ImportError: No module named requests", please install it:\n$ sudo pip install requests');
import requests

data = {'zone': 'ZONE','type':'TYPE','domain':'example.org'} headers = {'Authorization': 'Bearer API_TOKEN'} r = requests.delete('https://brightdata.com/api/zone/domain_perm', data=json.dumps(data), headers=headers) print(r.content)
Share this

Was this article helpful?

0 out of 0 found this helpful