# Get Server Bans

> Retrieve a list of banned users in a server.

- ID: `get_server_bans`
- Type: Loop
- Category: [Users](https://inventor.bot/docs/reference/blocks/users.md)

> Only the first 1000 bans are returned.

- Loop block: write `for item := range get_server_bans(Args{...}) { ... }` and read the current item's outputs from `item`. See loops.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `server_id` | yes | ID of the server to retrieve bans from. |  |
| `body` |  | Blocks to run for each ban. | blocks: `func() { ... }` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `user_id` | ID of the banned user. |  |
| `reason` | Reason for the ban. |  |
| `ban_reason` | Reason for the ban (alias). |  |

**Example**

```go
for serverBan := range get_server_bans(Args{server_id: trigger.server_id}) {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "User ID: " + serverBan.user_id,
	})
}
```