---
title: "Edit Fail2Ban"
method: POST
path: "/api/v1/edit/fail2ban"
tags: ["Fail2Ban"]
---

# Edit Fail2Ban

`POST /api/v1/edit/fail2ban`

Using this endpoint you can edit the Fail2Ban config and black or whitelist new ips.

## Request body

- object
  - `attr` object — array containing the fail2ban settings
    - `backlist` string — the backlisted ips or hostnames separated by comma
    - `ban_time` number — the time an ip should be banned
    - `ban_time_increment` boolean — if the time of the ban should increase each time
    - `max_attempts` number — the maximum numbe of wrong logins before a ip is banned
    - `max_ban_time` number — the maximum time an ip should be banned
    - `netban_ipv4` number — the networks mask to ban for ipv4
    - `netban_ipv6` number — the networks mask to ban for ipv6
    - `retry_window` number — the maximum time in which a ip as to login with false credentials to be banned
    - `whitelist` string — whitelisted ips or hostnames sepereated by comma
  - `items` unknown

## Response `200`

OK

## Other responses

- `401` — Unauthorized

## Changes

- **2023-03-17** `a1b002629e60` — 2 info
  - added the new optional request property `attr/ban_time_increment`
  - added the new optional request property `attr/max_ban_time`
- **2020-06-07** `47523aca063a` — 2 warning
  - removed the request property `attr/ban_time_increment`
  - removed the request property `attr/max_ban_time`

[Change history](https://skmtc.dev/mailcow/apis/mailcow-api/changes/api/v1/edit/fail2ban/post.md)

---

[API](https://skmtc.dev/mailcow/apis/mailcow-api.md) · [All operations](https://skmtc.dev/mailcow/apis/mailcow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mailcow/mailcow-api/revisions/ae01d1d7886a/schema)
