Skip to main content

Get rule list

GET
https://api.agora.io/dev/v1/kicking-rule

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

Request

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

Request header

  • Content-Type: application/json
  • The request header must contain the Authorization field. For details, see RESTful authentication.

Query parameters

QUERY
  • appid stringrequired

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

Response

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

OK
  • status string

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

  • rules array

    The list of banning rules. Each object in the array represents one banning rule and contains the following fields:

    Show propertiesHide properties
    • id number

      The rule ID. Required to update or delete the rule.

    • appid string

      The App ID of the project.

    • uid number

      The user ID.

    • opid number

      The operation ID, which can be used to track operation records when troubleshooting.

    • cname string

      The channel name.

    • ip string

      The IP address of the user.

    • ts string

      The UTC time when this rule expires.

    • privileges array

      The banned user privileges. 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.
    • createAt string

      The UTC time when this rule was created.

    • updateAt string

      The UTC time when this rule was last updated.

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.

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 Basic authentication.

Request example

Test this request in Postman or use one of the following code examples:


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

Response example


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