API reference
Security
Brute force protection, allow and block lists, firewall, security policies, hotlink protection.
Save hotlink protection
PUT/api/v1/accounts/{id}/hotlink
Parameters
| Name | In |
|---|---|
id | path |
Request body
| Field | Type |
|---|---|
allow_direct | boolean |
allowed | array of string |
enabled | boolean |
extensions | array of string |
redirect | string |
Responses
- 202 Accepted (runs in the background)
Body
Field Type job_idstring optionsStoreWebOptions - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
Unblock an IP address from the account's sites
DELETE/api/v1/accounts/{id}/ip-blocks
Parameters
| Name | In |
|---|---|
id | path |
entry | query |
Responses
- 202 Accepted (runs in the background)
Body
Field Type job_idstring optionsStoreWebOptions - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
Block an IP address from the account's sites
POST/api/v1/accounts/{id}/ip-blocks
Parameters
| Name | In |
|---|---|
id | path |
Request body
| Field | Type |
|---|---|
entry | string |
Responses
- 202 Accepted (runs in the background)
Body
Field Type job_idstring optionsStoreWebOptions - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
Minimum password strength
GET/api/v1/password-policy
Tells password forms the minimum strength per kind of password (not secret: it is enforced anyway).
Responses
- 200 OK
Body
Field Type min_lengthinteger minimumsmap of integer
Two-factor authentication overview
GET/api/v1/security/2fa
Responses
- 200 OK
Body
Field Type adminsarray of StoreAdminTwoFactor customersobject Field Type totalinteger with_2fainteger issuerstring issuer_effectivestring mestring require_2fa_adminsboolean require_2fa_customersboolean - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Turn off an admin's two-factor authentication
DELETE/api/v1/security/2fa/admins/{id}
Parameters
| Name | In |
|---|---|
id | path |
Responses
- 204 Done, no content
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: root-only
- 404 Not Found: not-found
- 409 Conflict: self
- 500 Internal Server Error: internal
List blocked addresses
GET/api/v1/security/blocks
Responses
- 200 OK
Body
Field Type itemsarray of BlockView - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Block an address
POST/api/v1/security/blocks
Request body
| Field | Type |
|---|---|
hours | integer |
ip | string |
reason | string |
Responses
- 200 OK
Body
Field Type itemsarray of BlockView - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Unblock an address
DELETE/api/v1/security/blocks/{id}
Parameters
| Name | In |
|---|---|
id | path |
Responses
- 204 Done, no content
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 500 Internal Server Error: internal
Get the brute force protection settings
GET/api/v1/security/brute-force
Responses
- 200 OK
Body
Field Type geomap of any my_countrystring my_ipstring my_ip_trustedboolean settingsmap of any statsobject Field Type failures_24hinteger ip_blocksinteger user_locksinteger - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Save the brute force protection settings
PUT/api/v1/security/brute-force
Request body
map of any
Responses
- 200 OK
Body
Field Type geomap of any my_countrystring my_ipstring my_ip_trustedboolean settingsmap of any statsobject Field Type failures_24hinteger ip_blocksinteger user_locksinteger - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Update the country database
POST/api/v1/security/geo/update
Responses
- 200 OK
Body
map of any
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 502 Bad Gateway: geo-download
Brute force history
GET/api/v1/security/history
Parameters
| Name | In |
|---|---|
all | query |
limit | query |
q | query |
Responses
- 200 OK
Body
Field Type attemptsarray of StoreLoginAttempt eventsarray of StoreBFEvent - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
List allowed and blocked addresses and countries
GET/api/v1/security/lists
Parameters
| Name | In |
|---|---|
list | query |
Responses
- 200 OK
Body
Field Type itemsarray of StoreBFRecord my_countrystring my_ipstring - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Add to the allow or block list
POST/api/v1/security/lists
Request body
| Field | Type |
|---|---|
list | string |
reason | string |
value | string |
Responses
- 201 Created
Body
Field Type created_atalwaysinteger created_byalwaysstring expires_atinteger idalwaysstring kindalwaysstring listalwaysstring reasonstring valuealwaysstring - 400 Bad Request: validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Remove from the allow or block list
DELETE/api/v1/security/lists/{id}
Parameters
| Name | In |
|---|---|
id | path |
Responses
- 204 Done, no content
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: lockout
- 500 Internal Server Error: internal
Get the security policies
GET/api/v1/security/policies
Responses
- 200 OK
Body
Field Type my_ipstring password_featuresarray of SettingsOption policiesPoliciesView - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
Save the security policies
PUT/api/v1/security/policies
Request body
| Field | Type |
|---|---|
admin_allowed_ips | array of string |
admin_password_max_age_days | integer |
my_ip | string |
password_strength | map of integer |
require_2fa_admins | boolean |
require_2fa_customers | boolean |
smtp_restriction | boolean |
Responses
- 200 OK
Body
Field Type my_ipstring password_featuresarray of SettingsOption policiesPoliciesView - 400 Bad Request: rejected, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Firewall status and open ports
GET/api/v1/server/firewall
Parameters
| Name | In |
|---|---|
server | query |
Responses
- 200 OK
Body
map of any
- 400 Bad Request: rejected
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Open or close firewall ports
PUT/api/v1/server/firewall/ports
Parameters
| Name | In |
|---|---|
server | query |
Request body
| Field | Type |
|---|---|
open | boolean |
port | integer |
protocol | string |
Responses
- 200 OK
Body
map of any
- 400 Bad Request: rejected
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
List firewall rules
GET/api/v1/server/firewall/rules
Responses
- 200 OK
Body
Field Type kernelmap of any listsmap of integer my_ipstring rulesarray of FwRuleView smtp_restrictionboolean - 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Add a firewall rule
POST/api/v1/server/firewall/rules
Request body
| Field | Type |
|---|---|
action | string |
comment | string |
ports | string |
protocol | string |
source | string |
Responses
- 201 Created
Body
Field Type actionalwaysstring commentstring created_atinteger enabledboolean idstring portsstring positioninteger protocolstring sourcestring - 400 Bad Request: rejected, validation
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 500 Internal Server Error: internal
Delete a firewall rule
DELETE/api/v1/server/firewall/rules/{id}
Parameters
| Name | In |
|---|---|
id | path |
Responses
- 204 Done, no content
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: lockout
- 500 Internal Server Error: internal
Update a firewall rule
PATCH/api/v1/server/firewall/rules/{id}
Parameters
| Name | In |
|---|---|
id | path |
Request body
| Field | Type |
|---|---|
enabled | boolean |
Responses
- 200 OK
Body
Field Type actionalwaysstring commentstring created_atinteger enabledboolean idstring portsstring positioninteger protocolstring sourcestring - 400 Bad Request: rejected
- 401 Unauthorized: no session, or an invalid or expired token
- 403 Forbidden: the caller can't use this (privileges, token scope, feature turned off)
- 404 Not Found: not-found
- 409 Conflict: lockout
- 500 Internal Server Error: internal