Skip to content
Start in Cloud

Create site exclusion

POST
/api/sites/{id}/exclusions
curl --request POST \
--url https://hitkeep.com/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/exclusions \
--header 'Content-Type: application/json' \
--cookie hk_token=<hk_token> \
--data '{ "cidr": "example", "country_code": "example", "description": "example", "type": "cidr" }'

Creates a per-site IP/CIDR or country exclusion rule. Country exclusions use ISO 3166-1 alpha-2 country codes and affect new traffic only. Requires site data-control permission or the narrow instance site-exclusion permission.

id
required
string format: uuid
Media type application/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
<= 255 characters
type

Rule type. Omitted cidr requests remain accepted for backward compatibility.

string
Allowed values: cidr country

Created exclusion

Media type application/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
Allowed values: cidr country
Example
{
"type": "cidr"
}

Invalid exclusion rule

Media type application/json
object
message
string
Example generated
{
"message": "example"
}