# POST /security/flags

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the security group.

Refuse sign-ins from an IP address

- Who may call it: administrator
- Token scope, any of: security, all
- Answers: 201 Created

A manual login flag blocks sign-ins from the IP address even when the password is correct. The refusal lasts for the duration set by security.flag_time, which defaults to 900 seconds. A new manual flag replaces any existing flag for the IP address and restarts the duration.

Loopback IP addresses are exempt. If the Allow list covers the IP address, remove the matching entry before setting the flag. UrbeStack returns 400 if address is missing or empty.

## As a command

- [urbestack-login-refuse](https://urbestack.com/docs/commands/urbestack-login-refuse.md): Refuses logins from the IP address given by --address, even with a correct password.

## Request body

JSON.

- `address` (string, up to 64 characters, required)

## 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/flags" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "info@example.com"
  }'
```

Response, 201 Created:

```
{
  "address": "info@example.com",
  "refused": 1,
  "until": "text"
}
```

## Errors

- 400: <address> is loopback and is never refused
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: address is required
- 401: Authentication required
- 409: <address> is on Allow as <rule>, and an allowed address is never refused: remove it there first
