# Permissions

## Get Permissions

<mark style="color:blue;">`GET`</mark> `https://accountable.pixelninja.dev/:token/user/:uuid/permissions`

This will give you the user's permission level. You can use this endpoint 5 times per second.

#### Path Parameters

| Name  | Type   | Description                                                   |
| ----- | ------ | ------------------------------------------------------------- |
| token | string | This is your API token.                                       |
| uuid  | string | The UUID of the user you wish to get the permissions value of |

{% tabs %}
{% tab title="200 Returns just the permissions integer and nothing else." %}

```c
128
```

{% endtab %}

{% tab title="400 The token provided was incorrect." %}

```c
{ "code": 400, "message": "Bad request" }
```

{% endtab %}

{% tab title="404 The provided user could not be found." %}

```c
{ "code": 404, "message": "Not found" }
```

{% endtab %}
{% endtabs %}

## Edit Permissions

<mark style="color:orange;">`PUT`</mark> `https://accountable.pixelninja.dev/:token/user/:uuid`

This allows you to overwrite a user's permission level. You can use this endpoint 3 times per second.

#### Path Parameters

| Name  | Type   | Description                                                           |
| ----- | ------ | --------------------------------------------------------------------- |
| token | string | This is your API token.                                               |
| uuid  | string | This is the UUID of the user whose permissions you want to overwrite. |

#### Request Body

| Name  | Type   | Description                                 |
| ----- | ------ | ------------------------------------------- |
| value | number | This is the value you are overwriting with. |

{% tabs %}
{% tab title="202 The value has been successfully updated." %}

```c
{ "code": 202, "message": "Accepted" }
```

{% endtab %}

{% tab title="400 The token or entered permission value is incorrect." %}

```c
{ "code": 400, "message": "Bad request" }
```

{% endtab %}
{% endtabs %}

## Clear Permissions

<mark style="color:red;">`DELETE`</mark> `https://accountable.pixelninja.dev/:token/user/:uuid/permissions`

This will set the user's permissions to 0. This helps to relieve ratelimits from using a PUT request. You can use this endpoint 3 times per second.

#### Path Parameters

| Name  | Type   | Description                                                       |
| ----- | ------ | ----------------------------------------------------------------- |
| token | string | This is your API token.                                           |
| uuid  | string | This is the UUID of the user whose permissions you are resetting. |

{% tabs %}
{% tab title="204 The permission integer was successfully set to 0" %}

```c
{ "code": 204, "message": "No content" }
```

{% endtab %}

{% tab title="400 The provided token was incorrect." %}

```c
{ "code": 400, "message": "Bad request" }
```

{% endtab %}
{% endtabs %}
