Security API
The security checks test the PHP setup, the configuration and the web server. The rate limiter counts requests per IP address and blocks one that goes over a limit until its time runs out. See Security checks and Rate limits.
Admin calls need Module access on the Security card of the staff group’s Permissions tab, plus each call’s own permission below (Super Administrators have all). See Authentication.
Admin calls
Section titled “Admin calls”ip_lookup
Section titled “ip_lookup”POST /api/admin/security/ip_lookup
Looks up the country and network (ASN) of an IP address in the portal’s GeoIP databases.
Permission: View security information (security.view)
| Parameter | Type | Description |
|---|---|---|
ip |
string, required | An IPv4 or IPv6 address. |
Returns: ip (address, type: IPv4 or IPv6), country and asn: the database records, empty when the database has no record for the address.
Errors:
- The provided input was not a valid IP address. (code 9999)
list_checks
Section titled “list_checks”POST /api/admin/security/list_checks
Lists the security checks.
Permission: View security information (security.view)
No parameters.
Returns: A list of {id, name, description}. The checks are dangerousFunctions (Dangerous PHP functions), generalCheck (General Check), phpVersion (PHP Version Check) and webserver (Webserver Check).
Example
Request parameters:
{}result:
[ { "id": "phpVersion", "name": "PHP Version Check", "description": "Checks if the PHP version ClientFence is running on is still receiving security support." }]run_check
Section titled “run_check”POST /api/admin/security/run_check
Runs one security check.
Permission: Run security checks (security.run_checks)
| Parameter | Type | Description |
|---|---|---|
id |
string, required | The check id from list_checks, such as phpVersion. |
Returns: {result, message, id}; result is passed, warning or failed.
Errors:
- The check myCheck does not exist. (code 9999)
Example
Request parameters:
{ "id": "phpVersion"}result:
{ "result": "passed", "message": "PHP 8.4.14 is the latest version of PHP.", "id": "phpVersion"}run_checks
Section titled “run_checks”POST /api/admin/security/run_checks
Runs every security check.
Permission: Run security checks (security.run_checks)
No parameters.
Returns: A list of {result, message, id, name}, one per check, as in run_check.
rate_limit_status
Section titled “rate_limit_status”POST /api/admin/security/rate_limit_status
Whether the rate limiter is on.
Permission: View security information (security.view)
No parameters.
Returns: {enabled}: false only when the configuration file turns the rate limiter off.
rate_limit_get_list
Section titled “rate_limit_get_list”POST /api/admin/security/rate_limit_get_list
Lists the IP addresses that are blocked by a rate limit right now, one row per address and limit.
Permission: View security information (security.view)
| Parameter | Type | Description |
|---|---|---|
ip |
string | Only this IP address. |
search |
string | Part of an IP address or limit name. |
Returns: A list, sorted by address and limit, of policy (the limit’s name, such as api_login), ip, last_seen, limit, remaining, limited (always true), retry_after (when the block ends, ISO 8601) and retry_after_seconds. Not a paged list.
Errors:
- The provided input was not a valid IP address. (code 9999)
Example
Request parameters:
{}result:
[ { "policy": "api_login", "ip": "203.0.113.7", "last_seen": "2026-11-17T09:12:00+00:00", "limit": 10, "remaining": 0, "limited": true, "retry_after": "2026-11-17T10:00:00+00:00", "retry_after_seconds": 2880 }]rate_limit_reset_ip
Section titled “rate_limit_reset_ip”POST /api/admin/security/rate_limit_reset_ip
Resets the rate limit counters of one IP address, for every limit or for one, so it is no longer blocked.
Permission: Manage rate limits (security.manage_rate_limits)
| Parameter | Type | Description |
|---|---|---|
ip |
string, required | The IP address. |
policy |
string | Only this limit, such as api_login. Default: every limit. |
Returns: {ip, policy, removed}; removed is how many listed counters were removed.
Errors:
- The provided input was not a valid IP address. (code 9999)
A limit name that does not exist resets nothing and is not an error.
Example
Request parameters:
{ "ip": "203.0.113.7"}result:
{ "ip": "203.0.113.7", "policy": null, "removed": 1}rate_limit_reset_all
Section titled “rate_limit_reset_all”POST /api/admin/security/rate_limit_reset_all
Resets every rate limit counter of every IP address and account.
Permission: Manage rate limits (security.manage_rate_limits)
No parameters.
Returns: {cleared}: true when the counters were cleared.
This cannot be undone.

