> For the complete documentation index, see [llms.txt](https://docs.imagemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imagemash.io/api/api-methods/account/image-url-restriction/change-keyword-list-usage.md).

# Change keyword list usage

You can choose the usage of your list either `whitelist` or as a `blacklist`

## Change keyword list usage

<mark style="color:green;">`POST`</mark> `https://api.imagemash.io/v1/account/changeKeywordListUsage`

#### Headers

| Name                                     | Type   | Description                                 |
| ---------------------------------------- | ------ | ------------------------------------------- |
| apikey<mark style="color:red;">\*</mark> | String | Your API Key                                |
| name<mark style="color:red;">\*</mark>   | String | Accepts `whitelist` or `blacklist` as value |

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

```json
// Empty Body
```

{% endtab %}

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

```javascript
{
    msg: "error details"
    details: "..."
}   // Explanation of error
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized. Check your API Key" %}

```html
Unauthorized
```

{% endtab %}
{% endtabs %}

#### Example Codes

{% tabs %}
{% tab title="cURL" %}

```sh
curl --location --request POST 'https://api.imagemash.io/v1/account/changeKeywordListUsage' \
--header 'apikey: your_api_key' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'name=whitelist'
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://api.imagemash.io/v1/account/changeKeywordListUsage");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("apikey", "your_api_key");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("name", "whitelist");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.*;
import okhttp3.*;
public class main {
  public static void main(String []args) throws IOException{
    OkHttpClient client = new OkHttpClient().newBuilder()
      .build();
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(mediaType, "name=whitelist");
    Request request = new Request.Builder()
      .url("https://api.imagemash.io/v1/account/changeKeywordListUsage")
      .method("POST", body)
      .addHeader("apikey", "your_api_key")
      .addHeader("Content-Type", "application/x-www-form-urlencoded")
      .build();
    Response response = client.newCall(request).execute();
    System.out.println(response.body().string());
  }
}

```

{% endtab %}

{% tab title="Node.js" %}

```javascript
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
  'name': 'whitelist' 
});
var config = {
  method: 'post',
  url: 'https://api.imagemash.io/v1/account/changeKeywordListUsage',
  headers: { 
    'apikey': 'your_api_key', 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  maxRedirects: 0,
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.imagemash.io/v1/account/changeKeywordListUsage"

payload='name=whitelist'
headers = {
  'apikey': 'your_api_key',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require "uri"
require "net/http"

url = URI("https://api.imagemash.io/v1/account/changeKeywordListUsage")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["apikey"] = "your_api_key"
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "name=whitelist"

response = https.request(request)
puts response.read_body

```

{% endtab %}
{% endtabs %}
