> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Delete a custom list identifier

DELETE https://console.humansecurity.com/api/v1/botDefender/customLists/{listId}/identifiers/{identifierId}

Permanently remove a specific identifier from a custom list.

This endpoint returns success (`200`) even if the identifier was not found. 
Check the `deleted` field in the response to determine if an identifier was actually deleted.
- `deleted: 1` means the identifier was found and deleted
- `deleted: 0` means the identifier was not found (but request still succeeded)


Reference: https://docs.humansecurity.com/applications/reference/delete-custom-list-identifier

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://console.humansecurity.com/api` (Version 1 of the API, default)
- `https://console.humansecurity.com/api` (Version 2 of the API)

## Request

### Path parameters

- `listId` (string, required) — The unique identifier of the custom list
- `identifierId` (string, required) — The unique identifier of the custom list identifier

## Response

### 200

Identifier deleted successfully. Returns even if identifier was not found.

- `result` (boolean, required) — Indicates if the request was successful
- `message` (string, required) — Response message
- `content` (DeleteIdentifierResponseContent, optional)

## Errors

### 401 Unauthorized Error

Authentication token is missing or invalid

- `result` (boolean, required) — Indicates if the request was successful
- `message` (string, required) — Response message
- `content` (string, optional)

### 500 Internal Server Error

Internal server error

- `result` (boolean, required) — Indicates if the request was successful
- `message` (string, required) — Response message
- `content` (string, optional)

## Types

### DeleteIdentifierResponseContent

- `deleted` (integer, optional) — Number of identifiers deleted (0 if not found)
- `remaining` (integer, optional) — Number of identifiers remaining in the list

## Examples

### Identifier was found and deleted

**Response**

```json
{
  "result": true,
  "message": "success",
  "content": {
    "deleted": 1,
    "remaining": 149
  }
}
```

**SDK Code**

```python Identifier was found and deleted
import requests

url = "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript Identifier was found and deleted
const url = 'https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

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

```go Identifier was found and deleted
package main

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

func main() {

	url := "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Identifier was found and deleted
require 'uri'
require 'net/http'

url = URI("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Identifier was found and deleted
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Identifier was found and deleted
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Identifier was found and deleted
using RestSharp;

var client = new RestClient("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Identifier was found and deleted
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```

### Identifier was not found (still returns success)

**Response**

```json
{
  "result": true,
  "message": "success",
  "content": {
    "deleted": 0,
    "remaining": 150
  }
}
```

**SDK Code**

```python Identifier was not found (still returns success)
import requests

url = "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript Identifier was not found (still returns success)
const url = 'https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

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

```go Identifier was not found (still returns success)
package main

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

func main() {

	url := "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby Identifier was not found (still returns success)
require 'uri'
require 'net/http'

url = URI("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")

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

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Identifier was not found (still returns success)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Identifier was not found (still returns success)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Identifier was not found (still returns success)
using RestSharp;

var client = new RestClient("https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Identifier was not found (still returns success)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://console.humansecurity.com/api/v1/botDefender/customLists/64f8b12345678901234567ab/identifiers/64f8b12345678901234567cd")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

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()
```