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


---

# 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.getbeaned.me/developper-documentation/the-getbeaned-api.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.
