Get your free beta license ↗
API operation · security group
GET

/security/bans

First published 3 Oct 20260.1.0Unchanged since publication

List bans that match the filters

Who may call it
AdministratorResellerCustomer
Token scope, any of
securityreadall
Answers200 OK

The API returns one page of matching bans from the past 30 days, with pagination details and counts by service and state. The events field contains up to 100 of the latest bans and unbans, newest first, regardless of the filters.

Empty filter values are treated as omitted. The API returns 400 for invalid nonempty values of jail, service, since, until, q, or state.

Parameters

addressquery ·string, up to 64 characters
IP address to match exactly or CIDR network to match bans for IP addresses within that network.
jailquery ·string, matching ^[a-z0-9][a-z0-9-]{0,31}$
Name of the rule that issued the ban, using 1 to 32 lowercase letters, digits, or hyphens and starting with a letter or digit. The names default and includes are reserved.
servicequery ·string, one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat, own
Service protected by the rule, one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat, or own. Use own for rules outside UrbeStack's built-in service groups.
qquery ·string, up to 200 characters
IP address, CIDR network, or case-sensitive substring of the IP address or triggering log line, such as a mailbox or login. The search accepts up to 200 characters and excludes ASCII control characters.
sincequery ·string, matching ^\d{4}-\d\d-\d\d(?:[T ]\d\d:\d\d(?::\d\d)?)?Z?$
Inclusive lower bound on when the ban began, as a UTC date or date and time, such as 2026-09-17 or 2026-09-17T14:02:00Z. A date alone means 00:00:00 UTC on that date.
untilquery ·string, matching ^\d{4}-\d\d-\d\d(?:[T ]\d\d:\d\d(?::\d\d)?)?Z?$
Inclusive upper bound on when the ban began, as a UTC date or date and time, such as 2026-09-17 or 2026-09-17T14:02:00Z. A date alone means 23:59:59 UTC on that date.
statequery ·string, one of active, expired, unblocked, all
Ban state to match, one of active, expired, unblocked, or all. Defaults to all.
pagequery ·integer, 1 or more
Page number from 1 to 999999. Missing or invalid values default to 1, and a valid number past the last page returns the last page.
per_pagequery ·integer, 1 to 1000
Number of bans per page, from 1 to 1000. Defaults to 200 if omitted or invalid.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X GET "$API/security/bans?address=info@example.com&jail=text&service=ssh&q=text&since=text&until=text&state=active&page=1&per_page=1" \
  -H "Authorization: Bearer $TOKEN"
Response · 200 OK
{
  "active": 1,
  "bans": [
    {
      "address": "info@example.com",
      "banned_at": "text",
      "id": 1,
      "jail": "text",
      "line": "text",
      "scope": "all",
      "service": "ssh",
      "state": "active",
      "unbanned_at": "text",
      "unbanned_by": "text",
      "until": "text"
    }
  ],
  "events": [
    {
      "address": "info@example.com",
      "at": "text",
      "by": "text",
      "jail": "text",
      "kind": "ban",
      "line": "text",
      "until": "text"
    }
  ],
  "page": 1,
  "pages": 1,
  "per_page": 1,
  "service_list": [
    {
      "key": "panel.port",
      "label": "my laptop"
    }
  ],
  "services": {},
  "states": {},
  "total": 1
}

Errors

8 errors, each a status and a sentence
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
400A rule name is 1 to 32 lowercase letters, digits and dashes
400A service is one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat or own
400The search is up to 200 characters
400The state is active, expired, unblocked or all
401Authentication required
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/get-security-bans/