# GET /security/flags

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

UrbeStack release 0.2.35 API operation in the security group.

List login flags and sign-in policy thresholds

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

The response includes active, expired and lifted login flags from the last 30 days, newest first. With no nonempty kind, state, q, page or per_page parameter, flags contains the full list. With any of those parameters set, flags contains one page, and the response includes the total number of matching flags, counts by kind and state, and system-wide sign-in figures.

Page numbers range from 1 to 999999 and default to 1 when omitted or invalid. Requests past the last page return the last page. An empty result has one page. UrbeStack returns 400 if kind, state or q is invalid.

Both response formats include thresholds. The tries value is the failed sign-in threshold from security.flag_tries (default 10). The window and time values give the counting window and refusal duration in seconds, from security.flag_window and security.flag_time, respectively. Both default to 900 seconds.

## Parameters

- `kind` (query, string, one of panel, mail, passwd, manual): Login flag source, either panel for UrbeStack web interface sign-ins, mail for Dovecot sign-ins, passwd for attempts by a mailbox user to change their own password, or manual for flags set by an administrator. Omit kind to include all sources.
- `state` (query, string, one of active, expired, letin, all): Login flag state, either active for a current refusal, expired for a refusal whose duration elapsed, letin for a lifted flag, or all for every state. Defaults to all.
- `q` (query, string, up to 200 characters): Exact IP address, CIDR network that contains the IP address, or literal substring of the attempted login name or IP address. The search accepts up to 200 characters, excluding ASCII control characters.
- `page` (query, integer, 1 or more)
- `per_page` (query, integer, 1 to 1000): Number of flags per page, from 1 to 1000. Defaults to 200 when omitted or invalid.

## 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 GET "$API/security/flags?kind=panel&state=active&q=text&page=1&per_page=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "active": 1,
  "day": {
    "failed_sign_ins": 1,
    "refused_now": 1
  },
  "flags": [
    {
      "address": "info@example.com",
      "failures": 1,
      "first_at": "text",
      "flagged_at": "text",
      "kind": "panel",
      "login": "text",
      "protocol": "text",
      "refusals": 1,
      "state": "active",
      "unflagged_at": "text",
      "unflagged_by": "text",
      "until": "text"
    }
  ],
  "kinds": {},
  "page": 1,
  "pages": 1,
  "per_page": 1,
  "states": {},
  "thresholds": {
    "time": 1,
    "tries": 1,
    "window": 1
  },
  "total": 1
}
```

## Errors

- 400: A kind is panel, mail, passwd or manual
- 400: The search is up to 200 characters
- 400: The state is active, expired, letin or all
- 401: Authentication required
