# Bans

## Get all bans

<mark style="color:blue;">`GET`</mark> `https://plugin.tebex.io/bans`

Returns an array of all bans on your account.

#### Headers

| Name           | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| X-Tebex-Secret | string | The secret key of a server. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "data": [
        {
            "id": 2,
            "time": "2017-08-17T14:57:50+00:00",
            "ip": "",
            "payment_email": "",
            "reason": "Because of fraud",
            "user": {
                "ign": "test0",
                "uuid": "45611b2c5d284dfc96f65fa77d2a4f57"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Create a ban

<mark style="color:green;">`POST`</mark> `https://plugin.tebex.io/bans`

Create a ban against a player or/and IP address.

#### Headers

| Name           | Type   | Description                 |
| -------------- | ------ | --------------------------- |
| X-Tebex-Secret | string | The secret key of a server. |

#### Request Body

| Name   | Type   | Description                                |
| ------ | ------ | ------------------------------------------ |
| reason | string | The reason for the ban.                    |
| ip     | string | The IP address to also ban.                |
| user   | string | The username or UUID of the player to ban. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
    "data": {
        "id": 2,
        "time": "2017-08-17T14:57:50+00:00",
        "ip": "",
        "payment_email": "",
        "reason": "Because banned",
        "user": {
            "ign": "test0",
            "uuid": "45611b2c5d284dfc96f65fa77d2a4f57"
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tebex.io/plugin/endpoints/bans.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
