Sucuri API v2 — Allow / Block IP
API v2 - Allow IP (allowlist_ip)
Allow an IP address so it won’t be blocked by some security rules. It will also have access to admin panels if those are restricted to trusted IPs. By default the endpoint allows the IP address associated with the client’s HTTP request. To specify a custom IP, pass the ip parameter with a valid IPv4/IPv6 address.
sh
curl 'https://waf.sucuri.net/api?v2' \
--data 'k=API_KEY' \
--data 's=API_SECRET' \
--data 'a=allowlist_ip' \
--data 'ip=IP_ADDRESS' \
--data 'duration=(time in seconds)'
ip— optional. If unset, the caller’s current IP is used.duration— optional. If set, the IP is allowed temporarily for the given seconds.
API v2 - Remove Allowed IP (delete_allowlist_ip)
Removes an IP from the allowlist. By default removes the caller’s current IP; pass ip to remove a specific address.
sh
curl 'https://waf.sucuri.net/api?v2' \
--data 'k=API_KEY' \
--data 's=API_SECRET' \
--data 'a=delete_allowlist_ip' \
--data 'ip=IP_ADDRESS'
ip— optional. If unset, the caller’s current IP is used.
API v2 - Block IP (blocklist_ip)
Blocks an IP address so it can’t reach the site.
sh
curl 'https://waf.sucuri.net/api?v2' \
--data 'k=API_KEY' \
--data 's=API_SECRET' \
--data 'a=blocklist_ip' \
--data 'ip=IP_ADDRESS' \
--data 'duration=(time in seconds)'
ip— optional. If unset, the caller’s current IP is used.duration— optional. If set, the IP is blocked temporarily.
API v2 - Remove Block IP (delete_blocklist_ip)
Deletes a specified IP from the blocklist. The IP must be a valid IPv4/IPv6 address.
sh
curl 'https://waf.sucuri.net/api?v2' \
--data 'k=API_KEY' \
--data 's=API_SECRET' \
--data 'a=delete_blocklist_ip' \
--data 'ip=IP_ADDRESS'