> For the complete documentation index, see [llms.txt](https://warden.elapsed.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://warden.elapsed.dev/api-references/users.md).

# Users

How to get/remove/modify users in the database through requests.

## :man\_office\_worker: Getting a License User

This will get stored key/values from the user, Here is what stored in the user data object.

| Key          | Value                                               |
| ------------ | --------------------------------------------------- |
| License      | A 19 character string we use to link it to the user |
| Discord ID   | A discord ID string we use to link to the user      |
| Discord Name | A discord name string we use to link to the user    |
| Email        | An email we use to link to the user                 |

<mark style="color:blue;">`GET`</mark> `https://localhost:8080/api/v1/license/users/get`

This will retrieve user data from the database, What the user data contains are the network, checksum, products, public key, and a array of information.

#### Query Parameters

| Name  | Type   | Description                                                           |
| ----- | ------ | --------------------------------------------------------------------- |
| type  | String | The query type we are using to look up the user data                  |
| value | String | The value we use to math with the query type to look up the user data |

{% tabs %}
{% tab title="200: OK Valid input returns user data in JSON format" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid inputs for query patterns" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## :baby: Creating a License User

This will create a user in the database based on what the values have been given.

{% hint style="info" %}
We plan to add custom key/value information based on the user creation.
{% endhint %}

<mark style="color:green;">`POST`</mark> `https://localhost:8080/api/v1/license/users/add`

This will create a user in the database based on what values have been given.

#### Query Parameters

| Name          | Type   | Description                                   |
| ------------- | ------ | --------------------------------------------- |
| license       | String | A license key that we use to link to the user |
| discord\_id   | String | A discord id we use to link to the user       |
| discord\_name | String | A discord name we use to link to the user     |
| email         | String | A email that we use to link to the user       |

{% tabs %}
{% tab title="200: OK User has been created" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="400: Bad Request Missing key values" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## :skull: Deleting a License User

This will remove a License User from the database

{% hint style="danger" %}
Once a license user is removed they are removed FOREVER.
{% endhint %}

{% hint style="info" %}
We plan to add a rollback feature to retrieve deleted users from the past
{% endhint %}

<mark style="color:red;">`DELETE`</mark> `https://localhost:8080/api/v1/license/users/remove`

This will remove the user data from the database.

#### Query Parameters

| Name  | Type   | Description                                                           |
| ----- | ------ | --------------------------------------------------------------------- |
| type  | String | The query type we are using to look up the user data                  |
| value | String | The value we use to math with the query type to look up the user data |

{% tabs %}
{% tab title="200: OK The user has been removed from the database" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid inputs for query patterns" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}
