Server API: blocklist
Copy as MarkdownThese routes are on the server API, port 21114 (21121 in Docker). They take an API key in X-API-Key or a sign-in token; see The HTTP API.
Addresses, networks and device IDs the server refuses.
List the blocklist entries.
When the blocklist is not enabled, enabled is false, entries is empty and count is missing.
On the server API, port 21114. Needs blocklist.edit.
200: The entries (application/json)
| Field | Type | What it is |
|---|---|---|
enabled |
boolean | |
count |
integer | |
entries |
array of BlocklistEntry or null | null when the blocklist is empty |
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
Block an IP address, a CIDR network or a device ID.
The block is written in the audit log. Only a CIDR value is checked for its form.
On the server API, port 21114. Needs blocklist.edit.
Request body, application/json:
| Field | Type | Required | What it is |
|---|---|---|---|
value |
string | yes | the address, network or device ID |
type |
string, one of ip, id, cidr |
yes | |
reason |
string |
200: Blocked (application/json)
| Field | Type |
|---|---|
status |
"blocked" |
value |
string |
| Error | When |
|---|---|
| 400 | value is missing, type is not ip, id or cidr, or the CIDR is not valid |
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 503 | The blocklist is not enabled |
Unblock an IP address, a CIDR network or a device ID.
On the server API, port 21114. Needs blocklist.edit.
| Parameter | In | Type | Required | What it is |
|---|---|---|---|---|
entry |
path | string | yes | The value as it was blocked; a CIDR network with its slash encoded as %2F |
200: Unblocked (application/json)
| Field | Type |
|---|---|
status |
"unblocked" |
entry |
string |
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
| 404 | No such entry |
| 503 | The blocklist is not enabled |