Create team traffic exclusion REST API
const url = 'http://127.0.0.1:25737/api/user/teams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/exclusions';const options = { method: 'POST', headers: {cookie: 'hk_token=<hk_token>', 'Content-Type': 'application/json'}, body: '{"cidr":"example","country_code":"example","description":"example","path":"example","type":"cidr","user_agent":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:25737/api/user/teams/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/exclusions \ --header 'Content-Type: application/json' \ --cookie hk_token=<hk_token> \ --data '{ "cidr": "example", "country_code": "example", "description": "example", "path": "example", "type": "cidr", "user_agent": "example" }'Creates a forward-only CIDR, country, user-agent, or path exclusion for every site currently owned by the team. Requires team.manage_settings.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
IP or CIDR value for cidr rules. Plain IP values are normalized to /32 (IPv4) or /128 (IPv6).
ISO 3166-1 alpha-2 country code for country rules. Values are normalized to uppercase.
Path rule. Query and fragment are removed; duplicate or trailing slashes and dot segments are normalized before case-sensitive segment-boundary matching.
Rule type. Omitted cidr requests remain accepted for backward compatibility.
Case-insensitive substring for user_agent rules. Leading and trailing whitespace is removed.
Responses
Section titled “Responses”Created team exclusion
object
Normalized IP or CIDR value for cidr rules.
Uppercase ISO 3166-1 alpha-2 country code for country rules.
Creator ID. Omitted from inherited rows returned across scopes.
True when returned through a child scope’s effective read.
Normalized, query-free, case-sensitive path matched on segment boundaries.
Scope that owns this rule.
Owning site for site rules.
Owning team for team rules.
Case-insensitive user-agent substring for user_agent rules.
Example
{ "scope": "instance", "type": "cidr"}Invalid exclusion rule
object
Examplegenerated
{ "message": "example"}Access denied
object
Examplegenerated
{ "message": "example"}