API operation · security group
GET
/security/bans
First published 3 Oct 2026
0.1.0Unchanged since publicationList bans that match the filters
Who may call it
AdministratorResellerCustomer
Token scope, any of
securityreadallAnswers200 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 charactersIP 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, ownService 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 charactersIP 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, allBan state to match, one of active, expired, unblocked, or all. Defaults to all.
pagequery ·integer, 1 or morePage 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 1000Number 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 sentence400'<n>' is a name fail2ban keeps for itself400<what> is a date (2026-09-17) or a date and time (2026-09-17T14:02:00Z), UTC400<what> is not a real date400A rule name is 1 to 32 lowercase letters, digits and dashes400A service is one of ssh, panel, mail, webmail, phpmyadmin, ftp, sites, repeat or own400The search is up to 200 characters400The state is active, expired, unblocked or all401Authentication requiredNo error of this operation matches.
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/