Create global exclusion REST API
POST
/api/admin/exclusions
const url = 'https://hitkeep.com/api/admin/exclusions';const options = { method: 'POST', headers: {cookie: 'hk_token=<hk_token>', 'Content-Type': 'application/json'}, body: '{"cidr":"example","country_code":"example","description":"example","type":"cidr"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://hitkeep.com/api/admin/exclusions \ --header 'Content-Type: application/json' \ --cookie hk_token=<hk_token> \ --data '{ "cidr": "example", "country_code": "example", "description": "example", "type": "cidr" }'Creates an instance-level IP/CIDR or country exclusion for all sites. Country exclusions use ISO 3166-1 alpha-2 country codes and affect new traffic only. Requires instance.manage_site_exclusions.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
cidr
IP or CIDR value for cidr rules. Plain IP values are normalized to /32 (IPv4) or /128 (IPv6).
string
country_code
ISO 3166-1 alpha-2 country code for country rules. Values are normalized to uppercase.
string
description
string
type
Rule type. Omitted cidr requests remain accepted for backward compatibility.
string
Responses
Section titled “Responses”Created exclusion
Media typeapplication/json
object
cidr
IP or CIDR value for cidr rules.
string
country_code
Uppercase ISO 3166-1 alpha-2 country code for country rules.
string
created_at
string format: date-time
created_by
string format: uuid
description
string
id
string format: uuid
site_id
string format: uuid
type
string
Example
{ "type": "cidr"}Invalid exclusion rule
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}