---
title: "Create team traffic exclusion REST API | HitKeep"
description: "Reference for the HitKeep REST API operation Create team traffic exclusion, including request parameters, responses, and authentication notes."
canonical: "https://hitkeep.com/api/operations/apiuserteamsidexclusions/post/"
---

# Create team traffic exclusion REST API

POST

/api/user/teams/{id}/exclusions

FetchcURL

```
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

- **[cookieAuth](https://hitkeep.com/api/#cookieauth)**

## Parameters

### Path Parameters

**id**

required

string format: uuid

## Request Bodyrequired

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

**path**

Path rule. Query and fragment are removed; duplicate or trailing slashes and dot segments are normalized before case-sensitive segment-boundary matching.

string

>= 1 characters

**type**

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

string

Allowed values: cidr country user_agent path

**user_agent**

Case-insensitive substring for user_agent rules. Leading and trailing whitespace is removed.

string

>= 1 characters

## Responses

### 201

Created team exclusion

application/json

object

**cidr**

Normalized IP or CIDR value for cidr rules.

string

**country_code**

Uppercase ISO 3166-1 alpha-2 country code for country rules.

string

**created_at**

required

string format: date-time

**created_by**

Creator ID. Omitted from inherited rows returned across scopes.

string format: uuid

**description**

string

**id**

required

string format: uuid

**inherited**

required

True when returned through a child scope’s effective read.

boolean

**path**

Normalized, query-free, case-sensitive path matched on segment boundaries.

string

**scope**

Scope that owns this rule.

string

Allowed values: instance team site

**site_id**

Owning site for site rules.

string format: uuid

**team_id**

Owning team for team rules.

string format: uuid

**type**

required

string

Allowed values: cidr country user_agent path

**user_agent**

Case-insensitive user-agent substring for user_agent rules.

string

##### Example

```
{
  "scope": "instance",
  "type": "cidr"
}
```

### 400

Invalid exclusion rule

application/json

object

**message**

string

##### Examplegenerated

```
{
  "message": "example"
}
```

### 403

Access denied

application/json

object

**message**

string

##### Examplegenerated

```
{
  "message": "example"
}
```

[Previous List team traffic exclusions](https://hitkeep.com/api/operations/apiuserteamsidexclusions/get/)[Next Delete team traffic exclusion](https://hitkeep.com/api/operations/apiuserteamsidexclusionsruleid/)
