# Create a banning rule (/en/api-reference/api-ref/rtc/create-ban-rule)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

Creates a rule for banning specified user privileges.

- OpenAPI: /openapi/rtc/channel-management.en.yaml
- Operation ID: cma-create-ban-rule
- Method: POST
- Path: /dev/v1/kicking-rule

## Servers

- https://api.agora.io

## Parameters

No parameters.

## Request body

- `appid` (string, required) - The App ID of the project. You can get it through one of the following methods:
- Copy from the [Agora Console](https://console.agora.io)
- Call the Get all projects API, and read the value of the
  `vendor_key` field in the response body.
No schema.
- `cname` (string) - The channel name.
No schema.
- `uid` (number) - The user ID. Do not set it to `0`.
No schema.
- `ip` (string) - The IP address of the user. Do not set it to `0`.
No schema.
- `time` (number) - The time duration (in minutes) to ban the user. Values outside the range [1,1440] are clamped to the nearest bound. Setting this to `0` disables the rule: users are set offline but can rejoin immediately.
No schema.
- `time_in_seconds` (number) - The time duration (in seconds) to ban the user. Values outside the range [10,86430] are clamped to the nearest bound. Setting this to `0` disables the rule: users are set offline but can rejoin immediately.
`time_in_seconds` takes effect. If neither is set, the default ban duration is 60 minutes (3600 seconds).
No schema.
- `privileges` (array, required) - The user privileges you want to block. Possible values:
- `join_channel`: Bans a user from joining a channel or
  kicks a user out of a channel.

- `publish_audio`: Bans a user from publishing audio.
- `publish_video`: Bans a user from publishing video.

To ban a user from both publishing audio and video, specify both `publish_audio` and `publish_video`.
  - `privileges.items` (string)
No schema.

## Responses

### 200

A `200` status code indicates success. The response body contains the result of the request.

- `status` (string) - The status of this request. `success` means the request succeeds.
No schema.
- `id` (number) - The rule ID. Save the rule ID to update or delete this rule later.
No schema.
### default

The request failed. See the `message` field in the response body for the reason. Refer to Response status codes for details.

No schema.
