http://localhost/api/v1/lists
scope: lists.write
Adds an entry to your blacklist or whitelist — the same list every future /screen, /ip/check, and lists/check call for your account consults.
| Field | Type | Optional | Description |
|---|---|---|---|
list_type |
string | Required | blacklist or whitelist. |
entity_type |
string | Optional | Defaults to ip. |
value |
string | Required | — |
reason |
string | Optional | Optional free text. |
curl -X POST http://localhost/api/v1/lists \
-H "Authorization: Bearer wsk_xxx_xxx" \
-d "list_type=blacklist&entity_type=ip&value=103.148.154.174"
<?php
$ch = curl_init('http://localhost/api/v1/lists');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer wsk_xxx_xxx']);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['list_type' => 'blacklist', 'entity_type' => 'ip', 'value' => '103.148.154.174']));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
import requests
response = requests.post("http://localhost/api/v1/lists",
headers={"Authorization": "Bearer wsk_xxx_xxx"},
data={"list_type": "blacklist", "entity_type": "ip", "value": "103.148.154.174"},
)
data = response.json()
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
body := strings.NewReader("list_type=blacklist&entity_type=ip&value=103.148.154.174")
req, _ := http.NewRequest("POST", "http://localhost/api/v1/lists", body)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Authorization", "Bearer wsk_xxx_xxx")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}
{
"data": {
"id": 128
}
}