# Give Whitelist

This endpoint enables the assignment of a product license to a specified user within your hub. By utilizing this route, you can effectively distribute access to various products, ensuring that users receive the correct entitlements based on their permissions or purchases.

## Assign a Whitelist to a user

<mark style="color:green;">`POST`</mark> `https://v2.parcelroblox.com/whitelist/assign`

#### Headers

<table><thead><tr><th width="256">Name</th><th width="170">Type</th><th>Description</th></tr></thead><tbody><tr><td>Authorization<mark style="color:red;">*</mark></td><td>string</td><td>prod_DGzVhVsrqNJi4b0Chd9mMPUI9</td></tr><tr><td>Content-Type</td><td>string</td><td>application/json</td></tr></tbody></table>

#### Request Body

| Name                                           | Type   | Description               |
| ---------------------------------------------- | ------ | ------------------------- |
| product\_id<mark style="color:red;">\*</mark>  | string | Product ID                |
| userid<mark style="color:red;">\*</mark>       | string | Roblox or Discord User ID |
| userid\_type<mark style="color:red;">\*</mark> | string | "roblox" or "discord"     |

{% tabs %}
{% tab title="200: OK " %}
If everything was able to process properly:

```javascript
{ "status": "200", "message": "OK", "data": { "userid": string, "userid_type": string, "product_id": string, "state": "License has been assigned" } }
```

{% endtab %}

{% tab title="400: Bad Request " %}
If you did not supply the Product ID, User ID and User ID Type:

```javascript
{ "status": "400", "message": "Missing Body Parameters.\nRequired params: product_id, userid, userid_type", "data": {} }
```

If the user already owns the license:

```javascript
{ "status": "400", "message": "User already owns license.", "data": { } }
```

If you provided an invalid User ID Type:

```javascript
{ "status": "400", "message": "Invalid type.\nAvailable types: roblox, discord", "data": {} }
```

{% endtab %}

{% tab title="401: Unauthorized " %}
If you provided an invalid authorization key:

```javascript
{ "status": "401", "message": "Invalid authorization key." }
```

If you did not provide an authorization key:

```javascript
{ "status": "401", "message": "No authorization key was provided." }
```

{% endtab %}

{% tab title="500: Internal Server Error " %}
If something was wrong on our end:

```javascript
{ "status": "500", "message": "Internal Server Error" }
```

{% endtab %}

{% tab title="404: Not Found " %}
If the product ID that you supplied does not exist:

```javascript
{ "status": "404", "message": "Product does not exist.", "data": {} }
```

If the user ID that you supplied does not exist within our Database:

```javascript
{ "status": "404", "message": "No Roblox Account associated to this Discord User ID.", "data": {} }
```

{% endtab %}
{% endtabs %}
