Get the banning rule list

Updated

Retrieves all banning rules.

gethttps://api.agora.io/dev/v1/kicking-rule

Use this endpoint to get the list of all banning rules.

Query Parameters

appid#*string

The App ID of the project. You can get it through one of the following methods:

  • Copy from the Agora Console
  • Call the Get all projects API, and read the value of the vendor_key field in the response body.

Request

  • The request URL and request body is case-sensitive. All requests must use HTTPS.

  • Content-Type: application/json

  • The request header must contain the Authorization field. For details, see RESTful authentication.

Response

  • A 200 status code indicates success. The response body contains the following parameters:

  • If the status code is not 200, the request fails. See the message field in the response body for the reason for this failure. Refer to Response status codes for details.

Response Body

application/json

Response schema

200application/json

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

status#optionalstring

The status of this request. success means the request succeeds.

rules#optionalarray

The list of banning rules. Each object in the array represents one banning rule.

defaultapplication/json

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

Reference

Best practices for rule management

To maximize the success rate of create, update, and delete operations, query requests are assigned a lower priority. Under poor network conditions, the success rate and accuracy of GET requests may degrade and some request records may be missing from the results.

When you call POST to create a rule where time is not set to 0, use the following best practices to update or delete it later:

  • Save the rule ID returned in the POST request on your server, and rely on this ID for subsequent update and delete operations.
  • To ensure that you can still obtain the rule ID under poor network conditions, set the timeout for the POST request to 20 seconds or higher. Make sure that the timeout is set to no less than 5 seconds.
  • In case the POST request times out or returns a 504 error, use the response of the GET method to obtain the rule ID. If the rule exists, it indicates that the POST request was successful, and you can save the rule ID on your server.

Authorization

This endpoint requires authentication.

basicAuth

Request examples

curl --request GET \  --url 'https://api.sd-rtn.com/dev/v1/kicking-rule?appid=4855xxxxxxxxxxxxxxxxxxxxxxxxeae2' \  --header 'Accept: application/json' \  --header 'Authorization: Basic <your_base64_encoded_credentials>'

Response example

{  "status": "success",  "rules": [    {      "id": 1953,      "appid": "4855xxxxxxxxxxxxxxxxxxxxxxxxeae2",      "uid": 589517928,      "opid": 1406,      "cname": "11",      "ip": "192.168.0.1",      "ts": "2026-01-09T07:23:06.000Z",      "privileges": [        "join_channel"      ],      "createAt": "2026-01-09T06:23:06.000Z",      "updateAt": "2026-01-09T14:23:06.000Z"    }  ]}
Empty