# 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 %}
