# POST /security/bans/allow

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the security group.

Add IP addresses from matching bans to the Allow list

- Who may call it: administrator
- Token scope, any of: security, all
- Answers: 200 OK

UrbeStack adds each matching IP address individually and lifts all active bans for that IP address, including bans outside the filters. Active, expired, and unblocked bans can match within the 30-day retention period. The Allow list takes precedence over the Deny list and exempts these IP addresses from future bans and fail2ban's attempt counts.

Supply at least one nonempty filter among address, jail, service, q, since, and until. The fields use the formats documented by GET /security/bans. A CIDR network in q takes precedence over a CIDR network in the address field. The API returns 400 if no filter is supplied or if jail, service, q, since, or until is invalid.

## As a command

- [urbestack-ban-allow](https://urbestack.com/docs/commands/urbestack-ban-allow.md): Adds individual IP addresses from matching bans to the Allow list.

## Request body

JSON, the type [BanFilter](https://urbestack.com/docs/api/types/BanFilter.md).

- `address` (string, up to 64 characters): IP address or network in CIDR notation. Matches bans for the specified IP address or for IP addresses within the network.
- `jail` (string, matching ^[a-z0-9][a-z0-9-]{0,31}$): Name of the rule that issued the ban.
- `q` (string, up to 200 characters): IP address, network, or text from the log line that triggered the ban.
- `service` (string, one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat, own): Service protected by the rule.
- `since` (string, matching ^\d{4}-\d\d-\d\d(?:[T ]\d\d:\d\d(?::\d\d)?)?Z?$): Inclusive start of the ban time range, given as a UTC date or date and time.
- `until` (string, matching ^\d{4}-\d\d-\d\d(?:[T ]\d\d:\d\d(?::\d\d)?)?Z?$): Inclusive end of the ban time range, given as a UTC date or date and time. A date alone includes the entire day.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/security/bans/allow" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "info@example.com",
    "jail": "text",
    "q": "text",
    "service": "ssh",
    "since": "text",
    "until": "text"
  }'
```

Response, 200 OK:

```
{
  "addresses": [
    "text"
  ],
  "allowed": [
    "text"
  ],
  "fail2ban": "text",
  "state": "text",
  "unblocked": 1
}
```

## Errors

- 400: '<n>' is a name fail2ban keeps for itself
- 400: <what> is a date (2026-09-17) or a date and time (2026-09-17T14:02:00Z), UTC
- 400: <what> is not a real date
- 400: A rule name is 1 to 32 lowercase letters, digits and dashes
- 400: A service is one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat or own
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid id
- 400: Refused. <value> 
- 400: Refused. <value> is loopback: the server's own services talk to each other over it
- 400: Say which bans: an address or network, a service or rule, a search, or a time window
- 400: Say which bans: an address or network, a service or rule, a search, or a time window; or clear all blocks
- 400: The search is up to 200 characters
- 401: Authentication required
- 404: Ban <id> not found
- 409: <value> holds <dn.value>, which is on Deny: remove it there first
- 409: <value> is on Allow as <al.value>: remove it there first
- 409: A <kind> rule for <value> already exists
