> For the complete documentation index, see [llms.txt](https://dadocs.rickyjs.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dadocs.rickyjs.xyz/endpoints/client/set.md).

# /set

{% hint style="info" %}
This endpoint will require a POST request.&#x20;
{% endhint %}

{% hint style="danger" %}
This endpoint is locked to Alpha testers for bug fixing.

> Please report any & all bugs to the [Support Server](https://discord.com/invite/9s65BZDrbV)
> {% endhint %}

{% hint style="info" %}
This endpoint supports the [Exclude](/exclude-header.md) header
{% endhint %}

### Endpoint Headers:&#x20;

* apikey - Your Api Auth Key <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)
* bot-token - Token of the Bot <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)

### Endpoint Body Parameters

* obj - Object of modifications (See Discord Docs [User](https://discord.com/developers/docs/resources/user#modify-current-user) | [Application](https://discord.com/developers/docs/resources/application#edit-current-application)) <mark style="color:orange;">**\[Object]**</mark> (<mark style="color:red;">**Required**</mark>)
* type - What to modify <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)\
  \- user\
  \- app

Responds with various HTTP status codes to indicate success or failure of the request:

* **200 OK**: The request was successful, and the changes have been applied.
* **400 Bad Request**: The request could not be understood or was missing required parameters.
* **401 Unauthorized**: Authentication failed or user does not have permissions.
* **404 Not Found**: The requested resource could not be found.
* **500 Internal Server Error**: An error occurred on the server.

Ensure to handle these responses appropriately in your application to manage errors and confirmations.

### Examples:

{% hint style="info" %}
Data API version required. Must replace `<version>` with either **release** or **beta**.
{% endhint %}

<details>

<summary>Bot Designer for Discord</summary>

Example usage of `/client/set` endpoint using BDFD

```bash
$httpAddHeader[apikey;<YOUR-API-KEY>]
$httpPost[https://bdfddata.rickyjs.xyz/<version>/client/set;{
'obj': {
'username': 'CoolBot1'
},
'type': 'user'
}]


$httpResult OR $httpResult[details]
```

</details>

<details>

<summary>Discord.js</summary>

Example usage of `/client/set` endpoint using Discord.js

```javascript
const axios = require('axios');
(async () => {
return await axios.post('https://bdfddata.rickyjs.xyz/<version>/client/set', {
'obj': {
'username': 'CoolBot1'
},
'type': 'user'
},
{ 
headers: {
'apikey': '<YOUR-API-KEY>'
}
}).then(res=>res.data)
})()
```

</details>

### Possible Responses (Codes)

<details>

<summary>Code 200</summary>

API succeeded and details were fetched.

```javascript
{
  status: 200,
  details: {
   "id": "1064100501764968488",
        "username": "BDFDData",
        "avatar": "9d119ef13aa1a6162543a0de7cc96af2",
        "discriminator": "6039",
        "public_flags": 65536,
        "flags": 65536,
        "bot": true,
        "banner": null,
        "accent_color": null,
        "avatar_decoration_data": null,
        "collectibles": null,
        "banner_color": null,
        "clan": null,
        "mfa_enabled": true,
        "locale": "en-US",
        "premium_type": 0,
        "verified": true
    },  }
}
```

</details>

<details>

<summary>Code 400</summary>

An error occurred that stopped execution.

```javascript
{
    status: 400
    error: 'Cannot read ...  (This can vary)'
}
```

</details>

<details>

<summary>Code 404</summary>

Invalid bot token was provided.{

```javascript
  status: 404,
  error: 'User cannot be found'
}
```

</details>
