# /updateWhitelist

Update a project's whitelist info

🚨Note! If you update the whitelist addresses, it overwrites all previous addresses

Things you can do:

* Turn whitelist on/off for a project
* Add in whitelisted addresses
* Choose either a standard or Merkle Tree whitelist

## Update a project you've already created.&#x20;

<mark style="color:green;">`POST`</mark> `/updateWhitelist`

Authenticate with basic auth where the username is your API key, e.g.&#x20;

`curl -X POST https://winter-api.usewinter.com/updateWhitelist -u sk_live_abcd=:`

`await axios.post(url,{ BODY }, { auth: { username: 'sk_live_abcd=' }})`

#### Request Body

| Name                                        | Type    | Description                                                                                                                                                                                                                                                                                   |
| ------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| email<mark style="color:red;">\*</mark>     | String  |                                                                                                                                                                                                                                                                                               |
| projectId<mark style="color:red;">\*</mark> | Number  |                                                                                                                                                                                                                                                                                               |
| \*                                          | String  | You need at least 1 param from /updateWhitelist to update in this request.                                                                                                                                                                                                                    |
| whitelistedAddresses                        | String  | An array of whitelist strings (e.g. \['0x123','0x456','0x789']). Note, adding/updating new whitelistedAddresses DELETES all previously whitelisted addresses. Make sure you add in ALL whitelistedAddresses you need                                                                          |
| whitelistStatus                             | Boolean | `true` for whitelist on, `false` for whitelist off (public mint). This also turns off or on the required address field. For example when the whitelist is turned on the required address field is turned on which takes away Winter's custodial wallet option in the checkout and vice versa. |
| whitelistType                               | String  | `merkle` or `naked` . Merkle is using a merkle proof (and will return a root hash for you to check against) and a naked whitelist is you're checking raw addresses in smart contract                                                                                                          |
| sandbox                                     | Boolean | <p><code>true</code> if you want to update a project in sandbox. <code>false</code> if you want to update a live project! </p><p></p><p>Defaults to <code>false</code>. </p>                                                                                                                  |

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

```javascript
{
    "success": true,
    "project_id": "6672",
    // If the whitelist is a merkle 
    "merkleHash": "0xe3d474873f2145a69f3d3c422c60489ff6acc328f27948cca5c4bea9eece0657"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
  "success": false,
  // The error message
  "error": "Need to valid param such as whitelistStatus, whitelistType, whitelistedAddresses"
}
```

{% 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.usewinter.com/platform-api/updatewhitelist.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.
