# List blocked IP addresses (/docs/apis/management/users/GetAllBlockedIps)

`GET /users/{user_id}/blocked_ips`

Retrieves a paginated list of IP addresses currently blocked for the specified user. Optional query parameters allow searching, filtering, and sorting the results.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Parameters

- `user_id` (path) (string, required) The unique identifier of the user.
- `page` (query) (integer, int32, default 1) The page number to retrieve.
- `size` (query) (integer, int32, default 10) The number of blocked IPs to return per page.
- `filter` (query) (string) Optional Lucene-style filter expression used to search by attributes.
- `sort` (query) (string) Sort expression in the format `field:direction`, where direction is `1` for ascending or `-1` for descending. Supported fields include - `block_until`, `last_sign_in_attempt`, `last_sign_in_success`.

## Response body

`200`, JSON. The user’s blocked IP addresses were retrieved successfully

Returns `UserIpAccessDetails[]`. Each item has these fields:

- `failure_count` (integer, required, int32) Consecutive sign-in failures from this IP address since the last successful sign-in.
- `block_until` (integer, date-time) Specifies the time until which sign-in attempts from this IP address are blocked (in Epoch).
- `sign_in_attempts_count` (integer, required, int32) Total number of sign-in attempts from this IP address.
- `ip` (string, required) The IP address from which sign-in attempts were made.
- `last_sign_in_attempt` (integer, required, date-time) Specifies the time of the most recent sign-in attempt from this IP address (in Epoch).

## Errors

- `400` Bad Request
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
  Same body as `400`.
- `422` Unprocessable Entity
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
  - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var userId = "WUgDGqaqzqkRmsgd3PFAT";

var page = 1;

var size = 10;

var filter = "(failure_count:[3 TO *] AND blocked_until:[1704067200 TO *])";

var sort = "block_until:1";


var result = await apiClient.Users.GetAllBlockedIpsAsync(userId, page, size, filter, sort);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const userId = 'WUgDGqaqzqkRmsgd3PFAT';

const page = 1;

const size = 10;

const filter = '(failure_count:[3 TO *] AND blocked_until:[1704067200 TO *])';

const sort = 'block_until:1';

const result = apiClient.users.getAllBlockedIps(userId, page, size, filter, sort);
```