---
title: "API Request to Blacklist IPs"
url: "https://docs.indusface.com/en/article/api-request-to-blacklist-ips"
language: "en"
last_updated: "2025-09-16T13:08:40.867Z"
---

# API Request to Blacklist IPs

This topic helps to blacklist IPs through API call.  

There are two steps involved in the process. 

#### Step 1: Authentication

To access this API, customers must authenticate using the **Token-Based Authentication** method**.**

Click [here](https://docs.indusface.com/en/article/apptrana-api-access-via-token-based-authentication) to learn about the authentication process through login API.

#### Step 2: Blacklist IPs

HTTP Method: POST

Endpoint: [https://tas.indusface.com/wafportal/rest/attack/blacklistIps](https://tas.indusface.com/wafportal/rest/attack/blacklistIps)

Header Parameters: application/json

Possible Responses:

200 – Success 

400 – Fail  

500 – Server error

#### Sample Request:

```plaintext
{
"websiteIds": [7425, 7434],
"ips": ["11.11.11.11", "22.22.22.22"]
}
```

#### Sample Response:

```javascript
{
    "params": {
        "jobId": "55rts",
        "blacklistedIps": [
            "11.11.11.11",
            "22.22.22.22"
        ]
    },
    "successMessage": "Successfully blacklisted IPs"
}
```

#### Bad Response 1:

```javascript
{
"errorMessages": [
"There must be at least one website to blacklist an IP for"
]
}
```

#### Bad Response 2:

```javascript
{
"errorMessages": [
"There must be at least one IP to blacklist"
]
}
```

#### Bad Response  3:

```javascript
{
"errorMessages": [
"IP range can take a max value of 31, please modify the subnet mask value range"
]
}
```

#### Bad Response 4:

```javascript
{
    "errorMessages": [
        "IP validation failed"
    ]
}
```

#### Bad Response 5:

```javascript
{
"errorMessages": [
"Internal Server Error"
]
}
```
