unban_pubkeys
unban_pubkeys type data
The unban_pubkeys method will remove all currently banned pubkeys from your ban list, or specific pubkeys from a user defined list.
Arguments
| Structure | Type | Description |
|---|---|---|
| pubkey | string | the pubkey to ban |
| unban_by.type | string | All to unban all pubkeys, or Few to provide a list of pubkeys to unban |
| unban_by.data | list | A list of pubkeys to unbanned. Only required when type is Few. |
Response
| Structure | Type | Description |
|---|---|---|
| still_banned | list | List of pubkeys which remain banned. For each pubkey, the reason it was banned pubkey.reason and the type of of ban pubkey.type is also returned. |
| unbanned | list | List of pubkeys which were unbanned. For each pubkey, the reason it was banned pubkey.reason and the type of of ban pubkey.type is also returned. |
| were_not_banned | list | If using unban_by.type: Few this will return a list of pubkeys which were not banned, but had been requested to be unbanned. |
📌 Examples
Command
POST unban_pubkeys
{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"unban_pubkeys","unban_by":{"type":"All"}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "All"
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"result": {
"still_banned": {},
"unbanned": {
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420": {
"type": "Manual",
"reason": "Having comedy mistaken for malice"
}
},
"were_not_banned": []
}
} Command
POST unban_pubkeys
{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"unban_pubkeys","unban_by":{"type":"Few","data":["2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420","2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"]}}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "unban_pubkeys",
"unban_by": {
"type": "Few",
"data": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420",
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"result": {
"still_banned": {
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520421": {
"type": "Manual",
"reason": "testing"
}
},
"unbanned": {
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520420": {
"type": "Manual",
"reason": "testing"
}
},
"were_not_banned": [
"2cd3021a2197361fb70b862c412bc8e44cff6951fa1de45ceabfdd9b4c520422"
]
}
}