# The GetBeaned API

## Add an user

<mark style="color:green;">`POST`</mark> `https://getbeaned.api-d.com/api/users/`

This endpoint allows you to upload an user data to the website. This is a required step to be able to add actions.\
\
The endpoint will update or create the user automatically.

#### Headers

| Name           | Type    | Description                                                         |
| -------------- | ------- | ------------------------------------------------------------------- |
| Update         | boolean | False if we don't want to update the user because the data is stale |
| Authentication | string  | Authentication token supplied on request.                           |

#### Request Body

| Name                          | Type    | Description                                                               |
| ----------------------------- | ------- | ------------------------------------------------------------------------- |
| discord\_default\_avatar\_url | string  | Default Discord CDN URL for the user avatar.                              |
| discord\_avatar\_url          | string  | Discord CDN URL to the PNG (static) or WEBP (animated) avatar of the user |
| discord\_discriminator        | integer | The user Discriminator (Excluding the `#`)                                |
| discord\_name                 | string  | Name of the user                                                          |
| discord\_id                   | boolean | Discord user ID                                                           |
| discord\_bot                  | boolean | Please set that to True if the user is a bot                              |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
 'status': 'ok',
 'message': 'User existed in database already',
 'result': '[User representation]'
 }
```

{% endtab %}

{% tab title="302 Error when saving the new user" %}

```javascript
{
    'status': 'error',
    'errors': ['List of errors']
}
```

{% endtab %}
{% endtabs %}

## API Users Counter

<mark style="color:blue;">`GET`</mark> `https://getbeaned.api-d.com/api/users/<int:guild_id>/<int:user_id>/counters/`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
|      | string |             |

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

```
```

{% endtab %}
{% endtabs %}
